我在minigui里面新建了一个gprs任务,调试(minigui下的调试方式)的时候在ModemInit(19200)设断点,按F10,无法跳到下一步。实验教程里面的gprs那个实验确实是可以的。但是在这里Modem无法初始化啊。请大家帮帮忙,搞不定这个问题毕业设计无法继续了啊。急!
#include "config.h" #include "stdlib.h"
extern void minigui_app_entry (void);
OS_EVENT *KeyMbox = NULL;
#define TaskStkLengh0 64 #define TaskStkLengh1 64 OS_STK TaskStk0 [TaskStkLengh0]; OS_STK TaskStk1 [TaskStkLengh1]; void Task0(void *pdata); void Task1(void *pdata); int main(void) { OSInit (); OSTaskCreate (Task0,(void *)0, &TaskStk0[TaskStkLengh0 - 1], 2); OSTaskCreate (Task1,(void *)0, &TaskStk1[TaskStkLengh1 - 1], 10); minigui_app_entry(); KeyMbox = OSMboxCreate(NULL); OSStart(); return(0); } void Task0(void *pdata) { pdata = pdata; TargetInit(); ModemInit(19200); GPRSSendMSG("13726226xxx","HI"); for (;;) { OSTimeDly(OS_TICKS_PER_SEC); } }
void Task1(void *pdata) { static uint8 s_key_sta = 0; static uint8 s_key_in = 0; uint16 key; pdata = pdata; while (1) { key = ZLG7290GetKey(); if(key&0x00FF) { if(s_key_sta==0) { s_key_in = (key-1)&0x000F; s_key_in |= 0x80; OSMboxPost(KeyMbox, (void *)&s_key_in); s_key_sta = 1; } else { switch(key&0xFF) { case 9: case 10: case 11: case 14: s_key_in = (key-1)&0x000F; s_key_in |= 0x80; OSMboxPost(KeyMbox, (void *)&s_key_in); break; default: break; } } } else { if(s_key_sta != 0) { s_key_in &= 0x0F; OSMboxPost(KeyMbox, (void *)&s_key_in); } s_key_sta = 0; } OSTimeDly(5); } } |