MTK 功能机 怎么添加一个后台应用?
时间:10-02
整理:3721RD
点击:
品台:mtk功能机
想添加一个在MMI上的gps后台应用,请问怎么写?这个应用的init函数应该放在哪里?
我现在是放在
MMI_BOOTUP_INIT_REG_BEGIN(EVT_ID_SRV_BOOTUP_COMPLETED)
......
#ifdef __SU_GPS_SUPPORT__
MMI_BOOTUP_INIT_REG(su_gps_init)
#endif
.......
这么写可以吗? 求大神指点一下。
/*********************************************************************/
想添加一个在MMI上的gps后台应用,请问怎么写?这个应用的init函数应该放在哪里?
我现在是放在
MMI_BOOTUP_INIT_REG_BEGIN(EVT_ID_SRV_BOOTUP_COMPLETED)
......
#ifdef __SU_GPS_SUPPORT__
MMI_BOOTUP_INIT_REG(su_gps_init)
#endif
.......
- gps.c:
- static void su_gps_main(void)
- {
- //open gps
- if (su_gps_cntx.port >= 0 && su_gps_cntx.conn_port_handle == -1)
- {
- su_gps_cntx.conn_port_handle = mdi_gps_UART_open(su_gps_cntx.port, MDI_GPS_UART_MODE_LOCATION, su_gps_cb);
- mdi_gps_set_work_port((U8)su_gps_cntx.port);
- gps_printf("su_gps_main: open gps OK.\n");
- }
- else
- {
- gps_printf("su_gps_main: cann't open gps.\n");
- }
- }
- void su_gps_init(void)
- {
- #if defined(__GPS_SUPPORT__)
- su_gps_cntx.port = mdi_get_gps_port();
- gps_printf("su_gps_init: port is %d", su_gps_cntx.port);
- #endif
- su_gps_cntx.is_use_agps = MMI_FALSE;
- su_gps_cntx.conn_port_handle = -1;
-
- su_gps_do_cold_start_register_hdlr();
- //su_gps_main(); //暂时注释掉
- StartTimer(su_GPS_OPEN_TIMER, su_PWRON_DELAY*1000, su_gps_main);
- }
这么写可以吗? 求大神指点一下。
/*********************************************************************/
高手在哪里?
可以放在这里
