diff --git a/aq_programmer.c b/aq_programmer.c index 1e52260..b964a43 100644 --- a/aq_programmer.c +++ b/aq_programmer.c @@ -644,10 +644,10 @@ void *set_aqualink_SWG( void *ptr ) void *get_aqualink_aux_labels( void *ptr ) { - struct programmingThreadCtrl *threadCtrl; - threadCtrl = (struct programmingThreadCtrl *) ptr; + struct programmingThreadCtrl *threadCtrl = + (struct programmingThreadCtrl *) ptr; struct aqualinkdata *aq_data = threadCtrl->aq_data; - + waitForSingleThreadOrTerminate(threadCtrl, AQ_GET_AUX_LABELS); if (pda_mode() == true) { @@ -676,8 +676,7 @@ void *get_aqualink_aux_labels( void *ptr ) cleanAndTerminateThread(threadCtrl); - // just stop compiler error, ptr is not valid as it's just been freed - return ptr; + return NULL; } void *set_aqualink_light_colormode( void *ptr ) diff --git a/pda_aq_programmer.c b/pda_aq_programmer.c index 0389ef5..dec684f 100644 --- a/pda_aq_programmer.c +++ b/pda_aq_programmer.c @@ -217,6 +217,7 @@ bool goto_pda_menu(struct aqualinkdata *aq_data, pda_menu_type menu) { while (pda_m_type() == PM_FW_VERSION || pda_m_type() == PM_BUILDING_HOME) { //logMessage(LOG_DEBUG, "******************PDA Device programmer delay on firmware or building home menu\n"); + // :TODO: remove this delay delay(500); } @@ -329,7 +330,7 @@ void *set_aqualink_PDA_device_on_off( void *ptr ) if (device > TOTAL_BUTTONS) { logMessage(LOG_ERR, "PDA Device On/Off :- bad device number '%d'\n",device); cleanAndTerminateThread(threadCtrl); - return ptr; + return NULL; } logMessage(LOG_INFO, "PDA Device On/Off, device '%s', state %d\n",aq_data->aqbuttons[device].pda_label,state); @@ -337,7 +338,7 @@ void *set_aqualink_PDA_device_on_off( void *ptr ) if (! goto_pda_menu(aq_data, PM_EQUIPTMENT_CONTROL)) { logMessage(LOG_ERR, "PDA Device On/Off :- can't find main menu\n"); cleanAndTerminateThread(threadCtrl); - return ptr; + return NULL; } // If single config (Spa OR pool) rather than (Spa AND pool) heater is TEMP1 and TEMP2 @@ -352,10 +353,9 @@ void *set_aqualink_PDA_device_on_off( void *ptr ) if ( find_pda_menu_item(aq_data, device_name, 13) ) { if (aq_data->aqbuttons[device].led->state != state) { - //printf("*** Select State ***\n"); logMessage(LOG_INFO, "PDA Device On/Off, found device '%s', changing state\n",aq_data->aqbuttons[device].pda_label,state); send_cmd(KEY_PDA_SELECT); - while (get_aq_cmd_length() > 0) { delay(500); } + //while (get_aq_cmd_length() > 0) { delay(500); } } else { logMessage(LOG_INFO, "PDA Device On/Off, found device '%s', not changing state, is same\n",aq_data->aqbuttons[device].pda_label,state); } @@ -363,13 +363,11 @@ void *set_aqualink_PDA_device_on_off( void *ptr ) logMessage(LOG_ERR, "PDA Device On/Off, device '%s' not found\n",aq_data->aqbuttons[device].pda_label); } - goto_pda_menu(aq_data, PM_HOME); - //while (_pgm_command != NUL) { delay(500); } + //goto_pda_menu(aq_data, PM_HOME); cleanAndTerminateThread(threadCtrl); - // just stop compiler error, ptr is not valid as it's just been freed - return ptr; + return NULL; } diff --git a/pda_menu.c b/pda_menu.c index b76c9d6..462249d 100644 --- a/pda_menu.c +++ b/pda_menu.c @@ -387,6 +387,7 @@ bool pda_m_clear() logMessage(LOG_DEBUG, "PDA menu clear\n"); _hlightindex = -1; + //_pda_m_type = PM_UNKNOWN; memset(_menu, 0, PDA_LINES * (AQ_MSGLEN+1)); return true; }