int iTVI_LCDPing(char cBouy){ iTVI_AddQueue(TVI_CLEAR , TVI_CLEAR_ALL, TVI_DELAY); iTVI_AddQueue(TVI_FONT_SEL, TVI_FONT_MED , TVI_DELAY); iTVI_AddQueue(TVI_COLUMN_START, 0x01 , TVI_DELAY); iTVI_AddQueue(TVI_PAGE_START , 0x01 , TVI_DELAY); iTVI_TransmitStr("Watch the display and press '#' to ping the "); switch(cMyStupidGlobal) { case SCI_A: iTVI_TransmitStr("Pin"); break; case SCI_B: iTVI_TransmitStr("Boat"); break; } iTVI_TransmitStr(" Bouy"); return ERROR_NONE;} after the 5 routines, CBouy is lost and gone forever and the switch command is performend on random data.... any ideas where to start looking?
int iTVI_LCDPing(char cBouy){ char cMyTemp = (cBouy & 0xFF); iTVI_AddQueue(TVI_CLEAR , TVI_CLEAR_ALL, TVI_DELAY); iTVI_AddQueue(TVI_FONT_SEL, TVI_FONT_MED , TVI_DELAY); iTVI_AddQueue(TVI_COLUMN_START, 0x01 , TVI_DELAY); iTVI_AddQueue(TVI_PAGE_START , 0x01 , TVI_DELAY); iTVI_TransmitStr("Watch the display and press '#' to ping the "); switch(cMyTemp) { case SCI_A: iTVI_TransmitStr("Pin"); break; case SCI_B: iTVI_TransmitStr("Boat"); break; } iTVI_TransmitStr(" Bouy"); return ERROR_NONE;}and the problem goes away... according to the Debugging enviroment cMyTemp is never "assigned" and the problem has vanished....
int iTVI_LCDPing(char cBouy) { iTVI_AddQueue(TVI_CLEAR , TVI_CLEAR_ALL, TVI_DELAY); iTVI_AddQueue(TVI_FONT_SEL, TVI_FONT_MED , TVI_DELAY); iTVI_AddQueue(TVI_COLUMN_START, 0x01 , TVI_DELAY); iTVI_AddQueue(TVI_PAGE_START , 0x01 , TVI_DELAY); iTVI_TransmitStr("Watch the display and press '#' to ping the "); switch(cBouy) { case SCI_A: iTVI_TransmitStr("Pin"); break; case SCI_B: iTVI_TransmitStr("Boat"); break; } iTVI_TransmitStr(" Bouy"); return ERROR_NONE; }