| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- /****************************************Copyright (c)****************************************************
- **
- ** http://www.powermcu.com
- **
- **--------------File Info---------------------------------------------------------------------------------
- ** File name: main.c
- ** Descriptions: The UCOSII application function
- **
- **--------------------------------------------------------------------------------------------------------
- ** Created by: AVRman
- ** Created date: 2010-11-9
- ** Version: v1.0
- ** Descriptions: The original version
- **
- **--------------------------------------------------------------------------------------------------------
- ** Modified by:
- ** Modified date:
- ** Version:
- ** Descriptions:
- **
- *********************************************************************************************************/
- /* Includes ------------------------------------------------------------------*/
- #include "includes.h"
- /**********************************************************************************************************
- * main()
- *
- * Description : This is the standard entry point for C code. It is assumed that your code will call
- * main() once you have performed all necessary initialization.
- *
- * Argument(s) : none.
- *
- * Return(s) : none.
- **********************************************************************************************************/
- extern unsigned char g_ucTickFlag;
- extern unsigned char g_ucSecFlag;
- /********************************************************************
- *ReadProductParaFromFlash
- 将sutNetPara重要参数从FLASH中读取出来
- *********************************************************************/
- void ReadProductParaFromFlash(void)
- {
- static const unsigned char DefMark[4]={'F','T','O','K'};
- unsigned char Rand;
- Rand=GetRandBySTM32ID();
- ReadFlashData(APP_CONFIG_ADDR,(unsigned char *)&sutProductPara,sizeof(SUT_PRODUCT_PARA));
- }
- int main (void)
- {
- char buf[50];
- W25Q64_Init();
- MsgDataBufferInit();
- MsgQueueInit(&ModemMsgQueue);
- Uart1Init();
- if (SysTick_Config(SystemCoreClock / 100)){
- //IapTrace("SysTick_Config Error!");
- while (1);
- }
- IapTrace(IAP_VERSION_NAME);
- ReadProductParaFromFlash();
- memset(&sutMsg,0,sizeof(SUT_MSG));
- NewTask(TASK_WAIT);
- while(1)
- {
- if(sutMsg.Uart1Recv){ //Use for PC
- Uart1Msg();
- sutMsg.Uart1Recv=0;
- memset(IapRxBuf,0,sizeof(IapRxBuf));
- }
- if(sutMsg.TaskStart){
- sutMsg.TaskStart=0;
- StartMsg();
- }
- if(sutMsg.Tick10ms){
- sutMsg.Tick10ms=0;
- }
- if(sutMsg.Tick500ms){
- sutMsg.Tick500ms=0;
- Tick500Msg();
- }
- }
- return (0);
- }
- //void assert_failed(uint8_t* file, uint32_t line)
- //{
- // printf("[AF]f:%s,l:%d\r\n",file,line);
- // while (1)
- // {}
- //}
- /*********************************************************************************************************
- END FILE
- *********************************************************************************************************/
|