added Console

This commit is contained in:
fewikay committed 2026-10-16 16:40:26 +02:00
1 parent 8a16d3af97
commit 728b978961
4 files changed
+48 -6

No files matched your search

@@ -27,6 +27,8 @@
#include "queue.h"
#include "stdio.h"
#include "assert.h"
#include "Spindle.h"
#include "Console.h"
/* USER CODE END Includes */
/* Private typedef -----------------------------------------------------------*/
@@ -104,12 +106,40 @@ static void playgroundTask(void* args)
(void)args;
while(1) {
printf("test \n");
vTaskDelay(pdMS_TO_TICKS(10));
}
vTaskDelete(xTaskGetCurrentTaskHandle());
}
void blink_green_led(){
while(1){
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_0, GPIO_PIN_SET);
vTaskDelay(pdMS_TO_TICKS(1000));
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_0, GPIO_PIN_RESET);
vTaskDelay(pdMS_TO_TICKS(1000));
}
}
void blink_yellow_led(){
while(1){
HAL_GPIO_WritePin(GPIOE, GPIO_PIN_1, GPIO_PIN_SET);
vTaskDelay(pdMS_TO_TICKS(100));
HAL_GPIO_WritePin(GPIOE, GPIO_PIN_1, GPIO_PIN_RESET);
vTaskDelay(pdMS_TO_TICKS(2000));
}
}
void blink_red_led(){
while(1){
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_14, GPIO_PIN_SET);
vTaskDelay(pdMS_TO_TICKS(1000));
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_14, GPIO_PIN_RESET);
vTaskDelay(pdMS_TO_TICKS(1000));
}
}
// --------------------------------------------------------------------------------------------------------------------
static int CapabilityFunc( int argc, char** argv, void* ctx )
// --------------------------------------------------------------------------------------------------------------------
@@ -272,8 +302,20 @@ int main(void)
uartRxQueue = xQueueCreate(64, sizeof(char));
HAL_UART_Receive_IT(&huart3, (uint8_t *)&myChar, sizeof(myChar));
//Konsole
ConsoleHandle_t c = CONSOLE_CreateInstance( 4*configMINIMAL_STACK_SIZE, configMAX_PRIORITIES - 5 );
CONSOLE_RegisterCommand(c, "capability", "prints a specified string of capability bits",
CapabilityFunc, NULL);
// create a playground task at the very beginning
xTaskCreate(playgroundTask, "playground", 128, NULL, 1, NULL);
xTaskCreate(blink_green_led, "blink_green_led", 1024, NULL, 1, NULL);
xTaskCreate(blink_yellow_led, "blink_yellow_led", 1024, NULL, 1, NULL);
xTaskCreate(blink_red_led, "blink_red_led", 1024, NULL, 1, NULL);
// mask a compiler warning by referencing the function but not using it (void cast)
(void)CapabilityFunc;