int main() { // create the UART queue queue_uart_char = xQueueGenericCreate(5, 10, 0); queue_lua_commands = xQueueGenericCreate(5, MAX_STRLEN + 1, 0); queue_stepmotor = xQueueGenericCreate(5, sizeof(int), 0); dac_init(); ledlib_init(); usart1_init(9600, &queue_uart_char); task_lua_init(&queue_lua_commands); task_stepmotor_init(&queue_stepmotor); // just send a message to indicate that it worksa usart1_write_string ("\r\nInit complete with motors\r\n"); xTaskCreate(task_receive_uart_chars, (signed char*)"uart-chars", 100, 0, 1, 0); vTaskStartScheduler(); /* * Should never reach here! */ ledlib_set_error_state(); }
xQueueHandle MPU_xQueueGenericCreate( unsigned portBASE_TYPE uxQueueLength, unsigned portBASE_TYPE uxItemSize, unsigned char ucQueueType ) { xQueueHandle xReturn; portBASE_TYPE xRunningPrivileged = prvRaisePrivilege(); xReturn = xQueueGenericCreate( uxQueueLength, uxItemSize, ucQueueType ); portRESET_PRIVILEGE( xRunningPrivileged ); return xReturn; }
QueueHandle_t MPU_xQueueGenericCreate( UBaseType_t uxQueueLength, UBaseType_t uxItemSize, uint8_t ucQueueType ) { QueueHandle_t xReturn; BaseType_t xRunningPrivileged = prvRaisePrivilege(); xReturn = xQueueGenericCreate( uxQueueLength, uxItemSize, ucQueueType ); portRESET_PRIVILEGE( xRunningPrivileged ); return xReturn; }
QueueHandle_t MPU_xQueueGenericCreate( UBaseType_t uxQueueLength, UBaseType_t uxItemSize, uint8_t ucQueueType ) { QueueHandle_t xReturn; BaseType_t xRunningPrivileged = xPortRaisePrivilege(); xReturn = xQueueGenericCreate( uxQueueLength, uxItemSize, ucQueueType ); vPortResetPrivilege( xRunningPrivileged ); return xReturn; }