Skip to content

Commit

Permalink
fix some misc function paramater type warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
skot committed Oct 7, 2024
1 parent abf6faa commit 6ac7582
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion components/connect/connect.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ void wifi_init(const char * wifi_ssid, const char * wifi_pass, const char * host

/* Initialize AP */
ESP_LOGI(TAG, "ESP_WIFI Access Point On");
esp_netif_t * esp_netif_ap = wifi_init_softap();
wifi_init_softap();

/* Initialize STA */
ESP_LOGI(TAG, "ESP_WIFI_MODE_STA");
Expand Down
2 changes: 1 addition & 1 deletion components/stratum/stratum_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ int STRATUM_V1_subscribe(int socket, char * model)
{
// Subscribe
char subscribe_msg[BUFFER_SIZE];
const esp_app_desc_t *app_desc = esp_ota_get_app_description();
const esp_app_desc_t *app_desc = esp_app_get_description();
const char *version = app_desc->version;
sprintf(subscribe_msg, "{\"id\": %d, \"method\": \"mining.subscribe\", \"params\": [\"bitaxe/%s/%s\"]}\n", send_uid++, model, version);
debug_stratum_tx(subscribe_msg);
Expand Down
4 changes: 2 additions & 2 deletions main/adc.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ static esp_adc_cal_characteristics_t adc1_chars;
// Sets up the ADC to read Vcore. Run this before ADC_get_vcore()
void ADC_init(void)
{
adc1_config_channel_atten(ADC1_CHANNEL_1, ADC_ATTEN_DB_11);
esp_adc_cal_characterize(ADC_UNIT_1, ADC_ATTEN_DB_11, ADC_WIDTH_BIT_DEFAULT, 0, &adc1_chars);
adc1_config_channel_atten(ADC1_CHANNEL_1, ADC_ATTEN_DB_12);
esp_adc_cal_characterize(ADC_UNIT_1, ADC_ATTEN_DB_12, ADC_WIDTH_BIT_DEFAULT, 0, &adc1_chars);
}

// returns the ADC voltage in mV
Expand Down
10 changes: 6 additions & 4 deletions main/http_server/http_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -464,9 +464,9 @@ static esp_err_t GET_system_info(httpd_req_t * req)
free(fallbackStratumUser);
free(board_version);

const char * sys_info = cJSON_Print(root);
const char * sys_info = cJSON_Print(root);
httpd_resp_sendstr(req, sys_info);
free(sys_info);
free((char *)sys_info);
cJSON_Delete(root);
return ESP_OK;
}
Expand Down Expand Up @@ -563,7 +563,7 @@ esp_err_t POST_OTA_update(httpd_req_t * req)
return ESP_OK;
}

void log_to_queue(const char * format, va_list args)
int log_to_queue(const char * format, va_list args)
{
va_list args_copy;
va_copy(args_copy, args);
Expand All @@ -575,7 +575,7 @@ void log_to_queue(const char * format, va_list args)
// Allocate the buffer dynamically
char * log_buffer = (char *) calloc(needed_size + 2, sizeof(char)); // +2 for potential \n and \0
if (log_buffer == NULL) {
return;
return 0;
}

// Format the string into the allocated buffer
Expand All @@ -599,6 +599,8 @@ void log_to_queue(const char * format, va_list args)
free((void*)log_buffer);
}
}

return 0;
}

void send_log_to_websocket(char *message)
Expand Down

0 comments on commit 6ac7582

Please sign in to comment.