/** ########################################################################## ** Filename : ** Project : ** Module : ** Processor : ** Version : 1.0 ** Compiler : ** Date/Time : ** Abstract : ** Contents : ** Note : 此文档用于规范代码书写; * 注意, * 1.所有文件用UTF-8格式 * 2.tab键空格4个 * 3.各模块,都要有 初始化函数 init, 反初始化函数 deinit, * 周期任务task,进入休眠goto sleep, * 唤醒后 goto wake ,判断是否可休眠judge_pre_sleep 等主要函数接口 * 4. ** ** (c) Copyright dmdz Co.,Ltd ** -------------------------------------------------------------------------- ** R E V I S I O N H I S T O R Y ** -------------------------------------------------------------------------- ** Date Ver Author Description ** -20191106- --V01-- --LYJ--- --初版-- ** -20230602- --V1.0-- --mingyea--- --修改-- ** #########################################################################*/ /*--------------------------------------------------------------------------- - I N C L U D E F I L E S ----------------------------------------------------------------------------*/ #include "appTask.h" #include "hardware.h" #include "stdio.h" #include "norflash.h" #include "uartapp.h" #include "bootapp.h" /*--------------------------------------------------------------------------- - D E F I N E S / M A C R O S ----------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------- - T Y P E D E F I N I T I O N S ----------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------- - S T A T I C V A R I A B L E S ----------------------------------------------------------------------------*/ static uint32_t timebase_counter; static uint32_t timebase_event; /*--------------------------------------------------------------------------- * G L O B A L V A R I A B L E S ----------------------------------------------------------------------------*/ uint16_t test[100]={0x6655}; uint32_t delaytest=0; extern uint8_t mapModeFlag; /*--------------------------------------------------------------------------- - C O N S T A N T S ----------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------- - F U N C T I O N P R O T O T Y P E ----------------------------------------------------------------------------*/ void appTask_TimebaseCallback() { timebase_event++; delaytest++; } void apptask_preinit(void) { } void apptask_init(void) { printf("system_init finashed\n"); timebase_counter = 0; timebase_event = 0; //NORFLASH_Init(); //norflash_test(); printf("apptask_init finashed\n"); //toggle_led(); bootApp_init();//bootapp_init } extern UART_HandleTypeDef huart1; uint8_t uart_tx_buf[8] = {1}; void apptask_maintask(void) { if (timebase_event > 0) { timebase_event--; timebase_counter++;// //1mstsk uartapp_maintask(); bootApp_mainTask(); if (timebase_counter >= 1000000) { timebase_counter = 0; } if (timebase_counter % 100 == 0) { //toggle_led(); } if (timebase_counter %500 == 0) { //HAL_UART_Transmit(&huart1,uart_tx_buf,8,100); //printf("test\n"); toggle_led(); } } } /* [] END OF FILE */