|
@ -54,7 +54,6 @@ void L0_RTC_init(void) |
|
|
Lc_delay_ms(200); |
|
|
Lc_delay_ms(200); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void L0_main_initled(void) |
|
|
void L0_main_initled(void) |
|
|
{ |
|
|
{ |
|
|
D_LED1_OFF(); |
|
|
D_LED1_OFF(); |
|
@ -71,28 +70,21 @@ void L0_main_initled(void) |
|
|
|
|
|
|
|
|
void L0_main_init(void) |
|
|
void L0_main_init(void) |
|
|
{ |
|
|
{ |
|
|
int r = 0; |
|
|
int r = 0; |
|
|
///>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>算法测试区域
|
|
|
|
|
|
|
|
|
|
|
|
///<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<算法测试区域
|
|
|
|
|
|
Lc_delay_ms(200); |
|
|
Lc_delay_ms(200); |
|
|
L0_main_initled(); |
|
|
L0_main_initled(); |
|
|
CLKDIV = 0;////不分频,使用focs
|
|
|
CLKDIV = 0;////不分频,使用focs
|
|
|
|
|
|
|
|
|
L0_uart1_open(); |
|
|
L0_uart1_open(); |
|
|
/// L0_uart2_open();
|
|
|
|
|
|
|
|
|
|
|
|
L3_debug_drv_init(); |
|
|
L3_debug_drv_init(); |
|
|
L1_task_tick_init(); |
|
|
L1_task_tick_init(); |
|
|
L0_timer0_Init();ET0 = 1; |
|
|
L0_timer0_Init();ET0 = 1; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
printf1("\r\nD_sys_MainFre %ld",D_sys_MainFre); |
|
|
printf1("\r\nD_sys_MainFre %ld",D_sys_MainFre); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
r = L3_S_init(); |
|
|
r = L3_S_init(); |
|
|
printf1("\r\nL3_S_init %d",r); |
|
|
printf1("\r\nL3_S_init %d",r); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//===============================================
|
|
|
//===============================================
|
|
@ -101,10 +93,7 @@ int r = 0; |
|
|
void main(void) |
|
|
void main(void) |
|
|
{ |
|
|
{ |
|
|
u16 a= 0; |
|
|
u16 a= 0; |
|
|
char d[9]={0xab}; |
|
|
char d[9]={0xab}; |
|
|
//-----------------------------------------------
|
|
|
|
|
|
//系统初始化
|
|
|
|
|
|
//----------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
L0_main_init(); |
|
|
L0_main_init(); |
|
|
L3_task_weight_init(); |
|
|
L3_task_weight_init(); |
|
@ -113,55 +102,31 @@ char d[9]={0xab}; |
|
|
|
|
|
|
|
|
printfs("\r\3 main while13\r\n"); |
|
|
printfs("\r\3 main while13\r\n"); |
|
|
|
|
|
|
|
|
//-----------------------------------------------
|
|
|
|
|
|
//系统主循环
|
|
|
|
|
|
//-----------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
while(1) |
|
|
while(1) |
|
|
{///44M 裸奔2us一个循环
|
|
|
{ |
|
|
//1>>>>>1>>>>>1>>>>>1>>>>>1>>>>>1>>>>> TTSS 1心跳>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.
|
|
|
|
|
|
if(1 == s_nos_tick.t1s_heartbeat)///
|
|
|
if(1 == s_nos_tick.t1s_heartbeat)///
|
|
|
{ |
|
|
{ |
|
|
s_nos_tick.t1s_heartbeat = 0; |
|
|
s_nos_tick.t1s_heartbeat = 0; |
|
|
///L1_uartD_uc('.');
|
|
|
///L1_uartD_uc('.');
|
|
|
D_LED2_REV(); |
|
|
D_LED2_REV(); |
|
|
} |
|
|
} |
|
|
//1<<<<<1<<<<<1<<<<<1<<<<<1<<<<<1<<<<< TTSS 1心跳<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<.
|
|
|
|
|
|
//--------------------------------------------------------------------------------------
|
|
|
TTSS_run_every(s_nos_tick.stamp,40) |
|
|
//>>>>>2>>>>>>2>>>>>2>>>>>2>>>>>2>>>>> TTSS 2 定期任务>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.
|
|
|
D_LED1_REV(); |
|
|
TTSS_run_every(s_nos_tick.stamp,40)////500 -7s 70-1s TTSS 2需要主循环定时工作的任务:stamp需要防止被其他程序使用
|
|
|
L4_weight_out(); |
|
|
D_LED1_REV(); L4_weight_out(); //// D_LED1_REV();
|
|
|
|
|
|
///55 0D 0C 90 F5 77 FF 52 80 00 00 00 33
|
|
|
///55 0D 0C 90 F5 77 FF 52 80 00 00 00 33
|
|
|
TTSS_run_every_end |
|
|
TTSS_run_every_end |
|
|
|
|
|
|
|
|
//// L1_expara_sample();///
|
|
|
|
|
|
//<<<<<2<<<<<<<2<<<<<<2<<<<<<2<<<<<<<TTSS 2 定期任务 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<.
|
|
|
|
|
|
//--------------------------------------------------------------------------------------
|
|
|
|
|
|
//>>>>>3>>>>>>>3>>>>>>3>>>>>>3>>>>>>>TTSS 3 debug>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.
|
|
|
|
|
|
if(L2_debug_ONcomand()) |
|
|
if(L2_debug_ONcomand()) |
|
|
{ |
|
|
{ |
|
|
L3_test_ONdebug(D_cmd_filter_debug);///fd xx xx///
|
|
|
L3_test_ONdebug(D_cmd_filter_debug);///fd xx xx///
|
|
|
|
|
|
|
|
|
L3_weight_ONdebug(D_cmd_filter_weight);///fd xx xx///
|
|
|
L3_weight_ONdebug(D_cmd_filter_weight);///fd xx xx///
|
|
|
//L3_ADC_debug(D_cmd_filter_adc);///fa xx xx
|
|
|
// L3_ADC_debug(D_cmd_filter_adc);///fa xx xx
|
|
|
//L3_moto_debug(D_cmd_filter_moto);///f0 xx xx/
|
|
|
// L3_moto_debug(D_cmd_filter_moto);///f0 xx xx/
|
|
|
/// L3_lora_debug(D_cmd_filter_lora);//
|
|
|
// L3_lora_debug(D_cmd_filter_lora);//
|
|
|
} |
|
|
} |
|
|
//<<<<<3<<<<<<<3<<<<<<<3<<<<<<3<<<<<<TTSS 3 debug><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<.
|
|
|
|
|
|
//--------------------------------------------------------------------------------------
|
|
|
|
|
|
//>>>>>>4>>>>>>>4>>>>>>4>>>>>>4>>>>>>TTSS 4 并行任务>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.
|
|
|
|
|
|
|
|
|
|
|
|
L3_task_weight_handler(&tst_weight); |
|
|
L3_task_weight_handler(&tst_weight); |
|
|
|
|
|
|
|
|
/// L2_task_move_handle(&ts_task_move);
|
|
|
|
|
|
//<<<<<4<<<<<<<<4<<<<<<4<<<<<<<4<<<<<TTSS 4 并行任务 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<.
|
|
|
|
|
|
//--------------------------------------------------------------------------------------
|
|
|
|
|
|
//>>>>>>5>>>>>>>5>>>>>>5>>>>>>5>>>>>>TTSS 5 日常任务 随机任务>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//<<<<<5<<<<<<<5<<<<<<<5<<<<<<5<<<<<<TTSS 5 日常任务 随机任务<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|