integrate & able to run cmsis-rtx with current code base

This commit is contained in:
hathach
2013-09-13 16:53:17 +07:00
parent 1f573eecf2
commit c71f5c6f1b
22 changed files with 2670 additions and 59 deletions

View File

@@ -88,7 +88,7 @@
</toolChain>
</folderInfo>
<sourceEntries>
<entry excluding="bsp/boards/embedded_artists/oem_base_board|freertos/freertoslpc/FreeRTOS_lpc43xx_m0_Tick.c|freertos/freertos/Source/portable|bsp/boards/EA4357|NGX|bsp/lpc13uxx|bsp/lpc11uxx" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
<entry excluding="cmsis_rtos_rtx/SRC/IAR|bsp/boards/embedded_artists/oem_base_board|freertos/freertoslpc/FreeRTOS_lpc43xx_m0_Tick.c|freertos/freertos/Source/portable|bsp/boards/EA4357|NGX|bsp/lpc13uxx|bsp/lpc11uxx" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
</sourceEntries>
</configuration>
</storageModule>
@@ -693,12 +693,15 @@
<option id="com.crt.advproject.gcc.thumb.1149795974" name="Thumb mode" superClass="com.crt.advproject.gcc.thumb" value="true" valueType="boolean"/>
<option id="gnu.c.compiler.option.preprocessor.def.symbols.510918973" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" valueType="definedSymbols">
<listOptionValue builtIn="false" value="__REDLIB__"/>
<listOptionValue builtIn="false" value="__CORTEX_M4F"/>
<listOptionValue builtIn="false" value="__CMSIS_RTOS "/>
<listOptionValue builtIn="false" value="__FPU_PRESENT"/>
<listOptionValue builtIn="false" value="__USE_CMSIS=CMSIS_LPC43xx_DriverLib"/>
<listOptionValue builtIn="false" value="CORE_M4"/>
<listOptionValue builtIn="false" value="MCU=MCU_LPC43XX"/>
<listOptionValue builtIn="false" value="BOARD=BOARD_EA4357"/>
<listOptionValue builtIn="false" value="TUSB_CFG_OS=TUSB_OS_FREERTOS"/>
<listOptionValue builtIn="false" value="TUSB_CFG_OS_TASK_PRIO=(configMAX_PRIORITIES-5)"/>
<listOptionValue builtIn="false" value="TUSB_CFG_OS=TUSB_OS_CMSIS_RTX"/>
<listOptionValue builtIn="false" value="TUSB_CFG_OS_TASK_PRIO=osPriorityRealtime"/>
<listOptionValue builtIn="false" value="DEBUG"/>
<listOptionValue builtIn="false" value="__CODE_RED"/>
</option>
@@ -707,8 +710,7 @@
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/bsp/lpc43xx/CMSIS_LPC43xx_DriverLib/inc}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/bsp}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/freertos}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/freertos/freertos/Source/include}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/cmsis_rtos_rtx/INC}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/tinyusb}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src}&quot;"/>
</option>
@@ -747,7 +749,7 @@
</toolChain>
</folderInfo>
<sourceEntries>
<entry excluding="freertos/freertoslpc/FreeRTOS_lpc43xx_m0_Tick.c|freertos/freertos/Source/portable|bsp/boards/EA4357|NGX|bsp/lpc13uxx|bsp/lpc11uxx" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
<entry excluding="cmsis_rtos_rtx/SRC/IAR|freertos/freertoslpc/FreeRTOS_lpc43xx_m0_Tick.c|freertos/freertos/Source/portable|bsp/boards/EA4357|NGX|bsp/lpc13uxx|bsp/lpc11uxx" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
</sourceEntries>
</configuration>
</storageModule>

View File

@@ -57,9 +57,10 @@
extern "C" {
#endif
#define KEYBOARD_APP_TASK_PRIO (TUSB_CFG_OS_TASK_PRIO-1)
#define MOUSE_APP_TASK_PRIO (KEYBOARD_APP_TASK_PRIO-1)
#define LED_BLINKING_APP_TASK_PRIO (tskIDLE_PRIORITY+1)
#define KEYBOARD_APP_TASK_PRIO osPriorityNormal
#define MOUSE_APP_TASK_PRIO osPriorityNormal
#define LED_BLINKING_APP_TASK_PRIO osPriorityNormal
#define CDC_SERIAL_APP_TASK_PRIO osPriorityNormal
#ifdef __cplusplus
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -695,6 +695,7 @@
<option id="com.crt.advproject.gcc.thumb.1149795974" name="Thumb mode" superClass="com.crt.advproject.gcc.thumb" value="true" valueType="boolean"/>
<option id="gnu.c.compiler.option.preprocessor.def.symbols.510918973" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" valueType="definedSymbols">
<listOptionValue builtIn="false" value="__REDLIB__"/>
<listOptionValue builtIn="false" value="__FPU_PRESENT"/>
<listOptionValue builtIn="false" value="__USE_CMSIS=CMSIS_LPC43xx_DriverLib"/>
<listOptionValue builtIn="false" value="CORE_M4"/>
<listOptionValue builtIn="false" value="MCU=MCU_LPC43XX"/>

View File

@@ -331,7 +331,7 @@
<Focus>0</Focus>
<ColumnNumber>0</ColumnNumber>
<tvExpOptDlg>0</tvExpOptDlg>
<TopLine>91</TopLine>
<TopLine>94</TopLine>
<CurrentLine>102</CurrentLine>
<bDave2>0</bDave2>
<PathWithFileName>..\src\main.c</PathWithFileName>
@@ -379,7 +379,7 @@
<Focus>0</Focus>
<ColumnNumber>0</ColumnNumber>
<tvExpOptDlg>0</tvExpOptDlg>
<TopLine>31</TopLine>
<TopLine>39</TopLine>
<CurrentLine>47</CurrentLine>
<bDave2>0</bDave2>
<PathWithFileName>..\src\mouse_app.c</PathWithFileName>
@@ -431,12 +431,12 @@
<GroupNumber>2</GroupNumber>
<FileNumber>7</FileNumber>
<FileType>1</FileType>
<tvExp>1</tvExp>
<tvExp>0</tvExp>
<Focus>0</Focus>
<ColumnNumber>0</ColumnNumber>
<tvExpOptDlg>0</tvExpOptDlg>
<TopLine>50</TopLine>
<CurrentLine>86</CurrentLine>
<TopLine>75</TopLine>
<CurrentLine>80</CurrentLine>
<bDave2>0</bDave2>
<PathWithFileName>..\..\bsp\boards\embedded_artists\board_ea4357.c</PathWithFileName>
<FilenameWithoutPath>board_ea4357.c</FilenameWithoutPath>
@@ -833,10 +833,10 @@
<FileType>1</FileType>
<tvExp>0</tvExp>
<Focus>0</Focus>
<ColumnNumber>17</ColumnNumber>
<ColumnNumber>49</ColumnNumber>
<tvExpOptDlg>0</tvExpOptDlg>
<TopLine>342</TopLine>
<CurrentLine>349</CurrentLine>
<TopLine>343</TopLine>
<CurrentLine>355</CurrentLine>
<bDave2>0</bDave2>
<PathWithFileName>..\..\bsp\lpc43xx\CMSIS_LPC43xx_DriverLib\src\lpc43xx_uart.c</PathWithFileName>
<FilenameWithoutPath>lpc43xx_uart.c</FilenameWithoutPath>
@@ -939,7 +939,7 @@
<Focus>0</Focus>
<ColumnNumber>0</ColumnNumber>
<tvExpOptDlg>0</tvExpOptDlg>
<TopLine>145</TopLine>
<TopLine>147</TopLine>
<CurrentLine>151</CurrentLine>
<bDave2>0</bDave2>
<PathWithFileName>..\..\bsp\lpc43xx\startup_keil\startup_LPC43xx.s</PathWithFileName>
@@ -961,10 +961,10 @@
<FileType>1</FileType>
<tvExp>0</tvExp>
<Focus>0</Focus>
<ColumnNumber>34</ColumnNumber>
<ColumnNumber>70</ColumnNumber>
<tvExpOptDlg>0</tvExpOptDlg>
<TopLine>68</TopLine>
<CurrentLine>71</CurrentLine>
<TopLine>1</TopLine>
<CurrentLine>9</CurrentLine>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\vendor\freertos\freertoslpc\FreeRTOSCommonHooks.c</PathWithFileName>
<FilenameWithoutPath>FreeRTOSCommonHooks.c</FilenameWithoutPath>
@@ -1071,12 +1071,12 @@
<GroupNumber>6</GroupNumber>
<FileNumber>45</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExp>1</tvExp>
<Focus>0</Focus>
<ColumnNumber>32</ColumnNumber>
<ColumnNumber>68</ColumnNumber>
<tvExpOptDlg>0</tvExpOptDlg>
<TopLine>127</TopLine>
<CurrentLine>172</CurrentLine>
<TopLine>5</TopLine>
<CurrentLine>31</CurrentLine>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\vendor\freertos\freertos\Source\portable\RVDS\ARM_CM4F\port.c</PathWithFileName>
<FilenameWithoutPath>port.c</FilenameWithoutPath>

View File

@@ -387,9 +387,9 @@
<FileType>1</FileType>
<tvExp>0</tvExp>
<Focus>0</Focus>
<ColumnNumber>22</ColumnNumber>
<ColumnNumber>25</ColumnNumber>
<tvExpOptDlg>0</tvExpOptDlg>
<TopLine>61</TopLine>
<TopLine>62</TopLine>
<CurrentLine>68</CurrentLine>
<bDave2>0</bDave2>
<PathWithFileName>..\src\main.c</PathWithFileName>

View File

@@ -49,7 +49,7 @@
//--------------------------------------------------------------------+
// MACRO CONSTANT TYPEDEF
//--------------------------------------------------------------------+
OSAL_TASK_DEF(cdc_serial_task_def, "cdc serial app", cdc_serial_app_task, 128, CDC_SERIAL_APP_TASK_PRIO);
OSAL_TASK_DEF("cdc serial app", cdc_serial_app_task, 128, CDC_SERIAL_APP_TASK_PRIO);
OSAL_QUEUE_DEF(queue_def, QUEUE_SERIAL_DEPTH, uint8_t);
static osal_queue_handle_t queue_hdl;
@@ -112,9 +112,10 @@ void cdc_serial_app_init(void)
{
memclr_(buffer_in, sizeof(buffer_in));
ASSERT( TUSB_ERROR_NONE == osal_task_create(&cdc_serial_task_def), (void) 0 );
queue_hdl = osal_queue_create(&queue_def);
queue_hdl = osal_queue_create( OSAL_QUEUE_REF(queue_def) );
ASSERT_PTR( queue_hdl, (void) 0 );
ASSERT( TUSB_ERROR_NONE == osal_task_create(OSAL_TASK_REF(cdc_serial_app_task)), (void) 0 );
}
//------------- main task -------------//

View File

@@ -55,7 +55,7 @@
//--------------------------------------------------------------------+
// INTERNAL OBJECT & FUNCTION DECLARATION
//--------------------------------------------------------------------+
OSAL_TASK_DEF(keyboard_task_def, "keyboard app", keyboard_app_task, 128, KEYBOARD_APP_TASK_PRIO);
OSAL_TASK_DEF("keyboard app", keyboard_app_task, 128, KEYBOARD_APP_TASK_PRIO);
OSAL_QUEUE_DEF(queue_kbd_def, QUEUE_KEYBOARD_REPORT_DEPTH, tusb_keyboard_report_t);
static osal_queue_handle_t queue_kbd_hdl;
@@ -107,9 +107,11 @@ void keyboard_app_init(void)
{
memclr_(&usb_keyboard_report, sizeof(tusb_keyboard_report_t));
ASSERT( TUSB_ERROR_NONE == osal_task_create(&keyboard_task_def), (void) 0 );
queue_kbd_hdl = osal_queue_create(&queue_kbd_def);
queue_kbd_hdl = osal_queue_create( OSAL_QUEUE_REF(queue_kbd_def) );
ASSERT_PTR( queue_kbd_hdl, (void) 0 );
ASSERT( TUSB_ERROR_NONE == osal_task_create( OSAL_TASK_REF(keyboard_app_task) ) ,
(void) 0 );
}
//------------- main task -------------//

View File

@@ -72,7 +72,7 @@
// INTERNAL OBJECT & FUNCTION DECLARATION
//--------------------------------------------------------------------+
OSAL_TASK_FUNCTION( led_blinking_task ) (void* p_task_para);
OSAL_TASK_DEF(led_blinking_task_def, "led blinking", led_blinking_task, 128, LED_BLINKING_APP_TASK_PRIO);
OSAL_TASK_DEF("led blinking", led_blinking_task, 128, LED_BLINKING_APP_TASK_PRIO);
void print_greeting(void);
static inline void wait_blocking_ms(uint32_t ms);
@@ -110,7 +110,7 @@ int main(void)
tusb_init();
//------------- application task init -------------//
(void) osal_task_create(&led_blinking_task_def);
(void) osal_task_create( OSAL_TASK_REF(led_blinking_task) );
#if TUSB_CFG_HOST_HID_KEYBOARD
keyboard_app_init();
@@ -131,9 +131,13 @@ int main(void)
//------------- start OS scheduler (never return) -------------//
#if TUSB_CFG_OS == TUSB_OS_FREERTOS
vTaskStartScheduler();
#elif TUSB_CFG_OS == TUSB_OS_NONE
os_none_start_scheduler();
#elif TUSB_CFG_OS == TUSB_OS_CMSIS_RTX
while(1)
{
osDelay(osWaitForever); // CMSIS RTX osKernelStart already started, main() is a task
}
#else
#error need to start RTOS schduler
#endif

View File

@@ -56,7 +56,7 @@
//--------------------------------------------------------------------+
// INTERNAL OBJECT & FUNCTION DECLARATION
//--------------------------------------------------------------------+
OSAL_TASK_DEF(mouse_task_def, "mouse app", mouse_app_task, 128, MOUSE_APP_TASK_PRIO);
OSAL_TASK_DEF("mouse app", mouse_app_task, 128, MOUSE_APP_TASK_PRIO);
OSAL_QUEUE_DEF(queue_mouse_def, QUEUE_MOUSE_REPORT_DEPTH, tusb_mouse_report_t);
static osal_queue_handle_t queue_mouse_hdl;
@@ -109,10 +109,11 @@ void mouse_app_init(void)
{
memclr_(&usb_mouse_report, sizeof(tusb_mouse_report_t));
ASSERT( TUSB_ERROR_NONE == osal_task_create(&mouse_task_def), (void) 0 );
queue_mouse_hdl = osal_queue_create(&queue_mouse_def);
queue_mouse_hdl = osal_queue_create( OSAL_QUEUE_REF(queue_mouse_def) );
ASSERT_PTR( queue_mouse_hdl, (void) 0 );
ASSERT( TUSB_ERROR_NONE == osal_task_create( OSAL_TASK_REF(mouse_app_task) ),
(void) 0 );
}
//------------- main task -------------//