Ej4 y Ej5
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
|
||||
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
|
||||
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
|
||||
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="-199833762000305539" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
||||
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="647843719379509656" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
||||
<language-scope id="org.eclipse.cdt.core.gcc"/>
|
||||
<language-scope id="org.eclipse.cdt.core.g++"/>
|
||||
</provider>
|
||||
@@ -16,7 +16,7 @@
|
||||
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
|
||||
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
|
||||
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
|
||||
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="-199833762000305539" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
||||
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="647843719379509656" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
||||
<language-scope id="org.eclipse.cdt.core.gcc"/>
|
||||
<language-scope id="org.eclipse.cdt.core.g++"/>
|
||||
</provider>
|
||||
|
||||
@@ -10,8 +10,15 @@
|
||||
|
||||
#include "stm32l4xx_hal.h"
|
||||
|
||||
#ifdef INC_FREERTOS_H
|
||||
#include "task.h"
|
||||
#endif
|
||||
|
||||
void LED_On(uint8_t led);
|
||||
void LED_Off(uint8_t led);
|
||||
void LED_Toggle(uint8_t led);
|
||||
void animation1(void);
|
||||
void animation2(void);
|
||||
void animation3(void);
|
||||
|
||||
#endif /* INC_LED_DRIVER_H_ */
|
||||
|
||||
@@ -23,4 +23,9 @@ typedef struct
|
||||
void CreateLedTask();
|
||||
void LedToggleTask(void* pArgs);
|
||||
|
||||
void LedAnimationTask(void* pArgs);
|
||||
void LedAnimationTask1(void* pArgs);
|
||||
void LedAnimationTask2(void* pArgs);
|
||||
void LedAnimationTask3(void* pArgs);
|
||||
|
||||
#endif /* INC_LED_TASK_H_ */
|
||||
|
||||
@@ -54,3 +54,76 @@ void LED_Toggle(uint8_t led)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void animation1(void)
|
||||
{
|
||||
int i;
|
||||
for(i = 0; i < 3; i++)
|
||||
{
|
||||
LED_On(i);
|
||||
#ifdef INC_FREERTOS_H
|
||||
vTaskDelay(150);
|
||||
#else
|
||||
HAL_Delay(150);
|
||||
#endif
|
||||
LED_Off(i);
|
||||
}
|
||||
for(i = 1; i > 0; i--)
|
||||
{
|
||||
LED_On(i);
|
||||
#ifdef INC_FREERTOS_H
|
||||
vTaskDelay(150);
|
||||
#else
|
||||
HAL_Delay(150);
|
||||
#endif
|
||||
LED_Off(i);
|
||||
}
|
||||
}
|
||||
|
||||
void animation2(void)
|
||||
{
|
||||
int i, j;
|
||||
for(j = 0; j < 5; j++)
|
||||
{
|
||||
for(i = 0; i < 3; i++)
|
||||
LED_On(i);
|
||||
|
||||
#ifdef INC_FREERTOS_H
|
||||
vTaskDelay(100);
|
||||
#else
|
||||
HAL_Delay(100);
|
||||
#endif
|
||||
|
||||
for(i = 0; i < 3; i++)
|
||||
LED_Off(i);
|
||||
|
||||
#ifdef INC_FREERTOS_H
|
||||
vTaskDelay(100);
|
||||
#else
|
||||
HAL_Delay(100);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
void animation3(void)
|
||||
{
|
||||
int i;
|
||||
for(i = 0; i < 3; i++)
|
||||
{
|
||||
LED_On(i);
|
||||
#ifdef INC_FREERTOS_H
|
||||
vTaskDelay(150);
|
||||
#else
|
||||
HAL_Delay(150);
|
||||
#endif
|
||||
}
|
||||
for(i = 2; i >= 0; i--)
|
||||
{
|
||||
LED_Off(i);
|
||||
#ifdef INC_FREERTOS_H
|
||||
vTaskDelay(150);
|
||||
#else
|
||||
HAL_Delay(150);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
void CreateLedTask()
|
||||
{
|
||||
/* EJERCICIOS 1/2/3
|
||||
LED_Config* cfg = pvPortMalloc(sizeof(LED_Config));
|
||||
|
||||
if (cfg != NULL)
|
||||
@@ -25,6 +26,42 @@ void CreateLedTask()
|
||||
1,
|
||||
NULL
|
||||
);
|
||||
*/
|
||||
|
||||
/* EJERCICIO 4
|
||||
xTaskCreate(
|
||||
LedAnimationTask,
|
||||
"LedAnimationTask",
|
||||
128,
|
||||
NULL,
|
||||
1,
|
||||
NULL
|
||||
);
|
||||
*/
|
||||
|
||||
/* EJERCICIO 5
|
||||
* - con la misma prioridad alternan continuamente entre ellas y son animaciones
|
||||
* sin sentido
|
||||
* - con prioridades distintas, visualmente y con un delay un poco más alto
|
||||
* podría parecer que se hacen una detrás de otra (en orden de prioridad)
|
||||
*/
|
||||
xTaskCreate(
|
||||
LedAnimationTask1,
|
||||
"LedAnimationTask1",
|
||||
128,
|
||||
NULL,
|
||||
1,
|
||||
NULL
|
||||
);
|
||||
|
||||
xTaskCreate(
|
||||
LedAnimationTask2,
|
||||
"LedAnimationTask2",
|
||||
128,
|
||||
NULL,
|
||||
2,
|
||||
NULL
|
||||
);
|
||||
}
|
||||
|
||||
void LedToggleTask(void* pArgs)
|
||||
@@ -59,3 +96,87 @@ void LedToggleTask(void* pArgs)
|
||||
vTaskDelete(NULL);
|
||||
}
|
||||
}
|
||||
|
||||
void LedAnimationTask(void* pArgs)
|
||||
{
|
||||
for(;;)
|
||||
{
|
||||
switch(ReadJoy())
|
||||
{
|
||||
case 0:
|
||||
// stand-by
|
||||
LED_Off(0);
|
||||
LED_Off(1);
|
||||
LED_Off(2);
|
||||
break;
|
||||
case 1:
|
||||
animation1();
|
||||
break;
|
||||
case 2:
|
||||
animation2();
|
||||
break;
|
||||
case 3:
|
||||
animation3();
|
||||
break;
|
||||
}
|
||||
vTaskDelay(50);
|
||||
}
|
||||
}
|
||||
|
||||
void LedAnimationTask1(void* pArgs)
|
||||
{
|
||||
for(;;)
|
||||
{
|
||||
int i;
|
||||
for(i = 0; i < 3; i++)
|
||||
{
|
||||
LED_On(i);
|
||||
vTaskDelay(150);
|
||||
LED_Off(i);
|
||||
}
|
||||
for(i = 1; i > 0; i--)
|
||||
{
|
||||
LED_On(i);
|
||||
vTaskDelay(150);
|
||||
LED_Off(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LedAnimationTask2(void* pArgs)
|
||||
{
|
||||
for(;;)
|
||||
{
|
||||
int i, j;
|
||||
for(j = 0; j < 5; j++)
|
||||
{
|
||||
for(i = 0; i < 3; i++)
|
||||
LED_On(i);
|
||||
|
||||
vTaskDelay(100);
|
||||
|
||||
for(i = 0; i < 3; i++)
|
||||
LED_Off(i);
|
||||
|
||||
vTaskDelay(100);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LedAnimationTask3(void* pArgs)
|
||||
{
|
||||
for(;;)
|
||||
{
|
||||
int i;
|
||||
for(i = 0; i < 3; i++)
|
||||
{
|
||||
LED_On(i);
|
||||
vTaskDelay(150);
|
||||
}
|
||||
for(i = 2; i >= 0; i--)
|
||||
{
|
||||
LED_Off(i);
|
||||
vTaskDelay(150);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,3 +1,6 @@
|
||||
../Core/Src/led_driver.c:10:6:LED_On 5
|
||||
../Core/Src/led_driver.c:26:6:LED_Off 5
|
||||
../Core/Src/led_driver.c:42:6:LED_Toggle 5
|
||||
../Core/Src/led_driver.c:58:6:animation1 3
|
||||
../Core/Src/led_driver.c:83:6:animation2 4
|
||||
../Core/Src/led_driver.c:108:6:animation3 3
|
||||
|
||||
Binary file not shown.
@@ -1,3 +1,6 @@
|
||||
../Core/Src/led_driver.c:10:6:LED_On 16 static
|
||||
../Core/Src/led_driver.c:26:6:LED_Off 16 static
|
||||
../Core/Src/led_driver.c:42:6:LED_Toggle 16 static
|
||||
../Core/Src/led_driver.c:58:6:animation1 16 static
|
||||
../Core/Src/led_driver.c:83:6:animation2 16 static
|
||||
../Core/Src/led_driver.c:108:6:animation3 16 static
|
||||
|
||||
@@ -1,2 +1,6 @@
|
||||
../Core/Src/led_task.c:10:6:CreateLedTask 2
|
||||
../Core/Src/led_task.c:30:6:LedToggleTask 3
|
||||
../Core/Src/led_task.c:10:6:CreateLedTask 1
|
||||
../Core/Src/led_task.c:64:6:LedToggleTask 3
|
||||
../Core/Src/led_task.c:97:6:LedAnimationTask 5
|
||||
../Core/Src/led_task.c:123:6:LedAnimationTask1 3
|
||||
../Core/Src/led_task.c:143:6:LedAnimationTask2 4
|
||||
../Core/Src/led_task.c:163:6:LedAnimationTask3 3
|
||||
|
||||
Binary file not shown.
@@ -1,2 +1,6 @@
|
||||
../Core/Src/led_task.c:10:6:CreateLedTask 24 static
|
||||
../Core/Src/led_task.c:30:6:LedToggleTask 32 static
|
||||
../Core/Src/led_task.c:10:6:CreateLedTask 16 static
|
||||
../Core/Src/led_task.c:64:6:LedToggleTask 32 static
|
||||
../Core/Src/led_task.c:97:6:LedAnimationTask 16 static
|
||||
../Core/Src/led_task.c:123:6:LedAnimationTask1 24 static
|
||||
../Core/Src/led_task.c:143:6:LedAnimationTask2 24 static
|
||||
../Core/Src/led_task.c:163:6:LedAnimationTask3 24 static
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -64,8 +64,8 @@ all: main-build
|
||||
main-build: P2_SETR2.elf secondary-outputs
|
||||
|
||||
# Tool invocations
|
||||
P2_SETR2.elf P2_SETR2.map: $(OBJS) $(USER_OBJS) /home/jomaa/STM32CubeIDE/workspace_1.19.0/P2_SETR2/STM32L475VGTX_FLASH.ld makefile objects.list $(OPTIONAL_TOOL_DEPS)
|
||||
arm-none-eabi-gcc -o "P2_SETR2.elf" @"objects.list" $(USER_OBJS) $(LIBS) -mcpu=cortex-m4 -T"/home/jomaa/STM32CubeIDE/workspace_1.19.0/P2_SETR2/STM32L475VGTX_FLASH.ld" --specs=nosys.specs -Wl,-Map="P2_SETR2.map" -Wl,--gc-sections -static --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -Wl,--start-group -lc -lm -Wl,--end-group
|
||||
P2_SETR2.elf P2_SETR2.map: $(OBJS) $(USER_OBJS) /home/jomaa/git/setr2-monorepo/P2_SETR2/STM32L475VGTX_FLASH.ld makefile objects.list $(OPTIONAL_TOOL_DEPS)
|
||||
arm-none-eabi-gcc -o "P2_SETR2.elf" @"objects.list" $(USER_OBJS) $(LIBS) -mcpu=cortex-m4 -T"/home/jomaa/git/setr2-monorepo/P2_SETR2/STM32L475VGTX_FLASH.ld" --specs=nosys.specs -Wl,-Map="P2_SETR2.map" -Wl,--gc-sections -static --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -Wl,--start-group -lc -lm -Wl,--end-group
|
||||
@echo 'Finished building target: $@'
|
||||
@echo ' '
|
||||
|
||||
|
||||
Reference in New Issue
Block a user