程序解读.docVIP

  • 5
  • 0
  • 约 9页
  • 2016-08-31 发布于河南
  • 举报
程序解读

zigbee的操作系统运行 ?? 在main函数里,对各项硬件进行初始化, /********************************************************************* * @fn????? main * @brief?? First function called after startup. * @return dont care *********************************************************************/ ZSEG int main( void ) { // Turn off interrupts?????????????????????? 关中断 osal_int_disable( INTS_ALL ); // Initialize HAL??????????????????????????? 初始化硬件层 HAL_BOARD_INIT(); // Make sure supply voltage is high enough to run?? 电压检测 zmain_vdd_check(); // Initialize stack memory???????? 初始化stack存储区 zmain_ram_init(); // Initialize board I/O?????????? 初始化板载IO InitBoard( OB_COLD ); // Initialze HAL drivers HalDriverInit(); // Initialize NV System???????????? 初始化非易失性存储 系统 osal_nv_init( NULL ); // Determine the extended address???? 确定扩展地址 zmain_ext_addr(); // Initialize basic NV items????????? 初始化基本NV条目 zgInit(); // Initialize the MAC ZMacInit(); #ifndef NONWK // Since the AF isnt a task, call its initialization routine afInit(); #endif // Initialize the operating system osal_init_system(); // Allow interrupts osal_int_enable( INTS_ALL ); // Final board initialization???????????????? 最后的板 初始化 InitBoard( OB_READY ); // Display information about this device??? 显示设备信息 zmain_dev_info(); /* Display the device info on the LCD */?????? //液晶显示 #ifdef LCD_SUPPORTED zmain_lcd_init(); #endif osal_start_system(); // No Return from here//-----------系统任务的主循环函数, ?????????????????????????????????? //在循环里面将遍历所有的任务事件,为触发事件的任务调用任务事件处理函数。 } // main() 当然也包括操作系统初始化, /********************************************************************* * @fn????? osal_init_system * * @brief * *?? This function initializes the task system by creating the *?? tasks defined in the task table (OSAL_Tasks.h). * * @param?? void * * @return ZSUCCESS */ byte osal_init_system( void ) { // Initialize the Memory Allocation System osal_mem_init(); // Initialize the message queue osal_qHead = NULL; #if defined( OSAL_TOTAL_MEM ) osal_msg_cnt = 0; #endif // Initiali

文档评论(0)

1亿VIP精品文档

相关文档