Skip to content

Commit

Permalink
Fixing sle118#59 and unnecessary jack insertion messages-release
Browse files Browse the repository at this point in the history
  • Loading branch information
sle118 committed Nov 21, 2020
1 parent 2687023 commit 2d573da
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 13 deletions.
6 changes: 0 additions & 6 deletions components/driver_bt/bt_app_source.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ extern void output_bt_tick(void);
extern char* output_state_str(void);
extern bool output_stopped(void);

extern void wifi_manager_update_status();

//int64_t connecting_timeout = 0;

static void bt_app_av_state_connecting(uint16_t event, void *param);
static void filter_inquiry_scan_result(esp_bt_gap_cb_param_t *param);

Expand Down Expand Up @@ -206,13 +202,11 @@ void set_app_source_state(int new_state){
if(bt_app_source_a2d_state!=new_state){
ESP_LOGD(TAG, "Updating state from %s to %s", APP_AV_STATE_DESC[bt_app_source_a2d_state], APP_AV_STATE_DESC[new_state]);
bt_app_source_a2d_state=new_state;
wifi_manager_update_status();
}
}
void set_a2dp_media_state(int new_state){
if(bt_app_source_media_state!=new_state){
bt_app_source_media_state=new_state;
wifi_manager_update_status();
}
}
void hal_bluetooth_init(const char * options)
Expand Down
4 changes: 3 additions & 1 deletion components/services/accessors.c
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,9 @@ cJSON * add_gpio_for_name(cJSON * list,const char * nvs_entry,const char * name,
int gpioNum=0;
if ((p = strcasestr(nvs_entry, name)) != NULL) {
gpioNum = atoi(strchr(p, '=') + 1);
cJSON_AddItemToArray(llist,get_gpio_entry(name,prefix,gpioNum,fixed));
if(gpioNum>=0){
cJSON_AddItemToArray(llist,get_gpio_entry(name,prefix,gpioNum,fixed));
}
}
return llist;
}
Expand Down
3 changes: 0 additions & 3 deletions components/services/battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ static struct {
.cells = 2,
};

extern void wifi_manager_update_status();

/****************************************************************************************
*
*/
Expand All @@ -66,7 +64,6 @@ static void battery_callback(TimerHandle_t xTimer) {
battery.avg = battery.sum / battery.count;
battery.sum = battery.count = 0;
ESP_LOGI(TAG, "Voltage %.2fV", battery.avg);
wifi_manager_update_status();
}
}

Expand Down
3 changes: 0 additions & 3 deletions components/services/monitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ bool jack_inserted_svc(void);
void (*spkfault_handler_svc)(bool inserted);
bool spkfault_svc(void);

extern void wifi_manager_update_status();

/****************************************************************************************
*
Expand Down Expand Up @@ -147,8 +146,6 @@ static void monitor_callback(TimerHandle_t xTimer) {
*/
static void jack_handler_default(void *id, button_event_e event, button_press_e mode, bool long_press) {
ESP_LOGD(TAG, "Jack %s", event == BUTTON_PRESSED ? "inserted" : "removed");
messaging_post_message(MESSAGING_INFO, MESSAGING_CLASS_SYSTEM,"jack is %s",BUTTON_PRESSED ? "inserted" : "removed");
wifi_manager_update_status();
if (jack_handler_svc) (*jack_handler_svc)(event == BUTTON_PRESSED);
}

Expand Down
2 changes: 2 additions & 0 deletions components/wifi-manager/http_server_handlers.c
Original file line number Diff line number Diff line change
Expand Up @@ -1182,6 +1182,8 @@ esp_err_t status_get_handler(httpd_req_t *req){
else {
httpd_resp_send_err(req, HTTPD_500_INTERNAL_SERVER_ERROR , "Error retrieving status object");
}
// update status for next status call
wifi_manager_update_status();

return ESP_OK;
}
Expand Down

0 comments on commit 2d573da

Please sign in to comment.