Changed log format for int32_t/uint32_t
This commit is contained in:
@@ -4,8 +4,8 @@ menu "Application Configuration"
|
||||
int
|
||||
default 33 if IDF_TARGET_ESP32
|
||||
default 46 if IDF_TARGET_ESP32S2
|
||||
default 19 if IDF_TARGET_ESP32C3
|
||||
default 48 if IDF_TARGET_ESP32S3
|
||||
default 19 if IDF_TARGET_ESP32C3
|
||||
|
||||
menu "CAN Setting"
|
||||
|
||||
@@ -51,9 +51,9 @@ menu "Application Configuration"
|
||||
config CTX_GPIO
|
||||
int "CTX GPIO number"
|
||||
range 0 GPIO_RANGE_MAX
|
||||
default 9 if IDF_TARGET_ESP32C3
|
||||
default 17 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3
|
||||
default 21 if IDF_TARGET_ESP32
|
||||
default 17 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3
|
||||
default 0 if IDF_TARGET_ESP32C3
|
||||
help
|
||||
GPIO number (IOxx) to CTX.
|
||||
Some GPIOs are used for other purposes (flash connections, etc.).
|
||||
@@ -62,9 +62,9 @@ menu "Application Configuration"
|
||||
config CRX_GPIO
|
||||
int "CRX GPIO number"
|
||||
range 0 GPIO_RANGE_MAX
|
||||
default 10 if IDF_TARGET_ESP32C3
|
||||
default 18 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3
|
||||
default 22 if IDF_TARGET_ESP32
|
||||
default 18 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3
|
||||
default 1 if IDF_TARGET_ESP32C3
|
||||
help
|
||||
GPIO number (IOxx) to CRX.
|
||||
Some GPIOs are used for other purposes (flash connections, etc.).
|
||||
|
||||
+4
-2
@@ -7,6 +7,8 @@
|
||||
CONDITIONS OF ANY KIND, either express or implied.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <inttypes.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include "freertos/FreeRTOS.h"
|
||||
@@ -139,7 +141,7 @@ static void http_rest_with_url(char * path, char * post_data)
|
||||
esp_http_client_set_post_field(client, post_data, strlen(post_data));
|
||||
esp_err_t err = esp_http_client_perform(client);
|
||||
if (err == ESP_OK) {
|
||||
ESP_LOGI(TAG, "HTTP POST Status = %d, content_length = %d",
|
||||
ESP_LOGI(TAG, "HTTP POST Status = %d, content_length = %lld",
|
||||
esp_http_client_get_status_code(client),
|
||||
esp_http_client_get_content_length(client));
|
||||
ESP_LOGI(TAG, "local_response_buffer=[%s]", local_response_buffer);
|
||||
@@ -157,7 +159,7 @@ void http_client_task(void *pvParameters)
|
||||
FRAME_t frameBuf;
|
||||
while (1) {
|
||||
xQueueReceive(xQueue_http_client, &frameBuf, portMAX_DELAY);
|
||||
ESP_LOGI(TAG, "canid=%x ext=%d topic=[%s]", frameBuf.canid, frameBuf.ext, frameBuf.topic);
|
||||
ESP_LOGI(TAG, "canid=%"PRIx32" ext=%d topic=[%s]", frameBuf.canid, frameBuf.ext, frameBuf.topic);
|
||||
for(int i=0;i<frameBuf.data_len;i++) {
|
||||
ESP_LOGI(TAG, "DATA=%x", frameBuf.data[i]);
|
||||
}
|
||||
|
||||
+3
-2
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <inttypes.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "freertos/FreeRTOS.h"
|
||||
@@ -138,7 +139,7 @@ static esp_err_t twai_send_handler(httpd_req_t *req)
|
||||
cJSON* state = cJSON_GetObjectItem(root, "canid");
|
||||
if (state) {
|
||||
canid = cJSON_GetObjectItem(root, "canid")->valueint;
|
||||
ESP_LOGI(TAG, "canid=%x", canid);
|
||||
ESP_LOGI(TAG, "canid=%"PRIx32, canid);
|
||||
} else {
|
||||
ESP_LOGE(TAG, "canid item not found");
|
||||
parse = false;
|
||||
@@ -209,7 +210,7 @@ static esp_err_t twai_send_handler(httpd_req_t *req)
|
||||
|
||||
// JSON parse success. Send twai data.
|
||||
if (parse) {
|
||||
ESP_LOGI(TAG, "twai_send_handler frame=%d canid=%x data_len=%d", frame, canid, data_len);
|
||||
ESP_LOGI(TAG, "twai_send_handler frame=%d canid=%"PRIx32" data_len=%d", frame, canid, data_len);
|
||||
ESP_LOG_BUFFER_HEX(TAG, data_value, data_len);
|
||||
twai_message_t tx_msg;
|
||||
tx_msg.extd = frame;
|
||||
|
||||
+2
-1
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <inttypes.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "freertos/FreeRTOS.h"
|
||||
@@ -348,7 +349,7 @@ esp_err_t build_table(TOPIC_t **topics, char *file, int16_t *ntopic)
|
||||
void dump_table(TOPIC_t *topics, int16_t ntopic)
|
||||
{
|
||||
for(int i=0;i<ntopic;i++) {
|
||||
ESP_LOGI(pcTaskGetName(0), "topics[%d] frame=%d canid=0x%x topic=[%s] topic_len=%d",
|
||||
ESP_LOGI(pcTaskGetName(0), "topics=[%d] frame=%d canid=0x%"PRIx32" topic=[%s] topic_len=%d",
|
||||
i, (topics+i)->frame, (topics+i)->canid, (topics+i)->topic, (topics+i)->topic_len);
|
||||
}
|
||||
|
||||
|
||||
+8
-7
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <inttypes.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "freertos/FreeRTOS.h"
|
||||
@@ -41,7 +42,7 @@ void twai_task(void *pvParameters)
|
||||
while (1) {
|
||||
esp_err_t ret = twai_receive(&rx_msg, pdMS_TO_TICKS(10));
|
||||
if (ret == ESP_OK) {
|
||||
ESP_LOGD(TAG,"twai_receive identifier=0x%x flags=0x%x data_length_code=%d",
|
||||
ESP_LOGD(TAG,"twai_receive identifier=0x%"PRIx32" flags=0x%"PRIx32" data_length_code=%d",
|
||||
rx_msg.identifier, rx_msg.flags, rx_msg.data_length_code);
|
||||
|
||||
int ext = rx_msg.flags & 0x01;
|
||||
@@ -50,9 +51,9 @@ void twai_task(void *pvParameters)
|
||||
|
||||
#if CONFIG_ENABLE_PRINT
|
||||
if (ext == STANDARD_FRAME) {
|
||||
printf("Standard ID: 0x%03x ", rx_msg.identifier);
|
||||
printf("Standard ID: 0x%03"PRIx32" ", rx_msg.identifier);
|
||||
} else {
|
||||
printf("Extended ID: 0x%08x", rx_msg.identifier);
|
||||
printf("Extended ID: 0x%08"PRIx32, rx_msg.identifier);
|
||||
}
|
||||
printf(" DLC: %d Data: ", rx_msg.data_length_code);
|
||||
|
||||
@@ -70,7 +71,7 @@ void twai_task(void *pvParameters)
|
||||
for(int index=0;index<npublish;index++) {
|
||||
if (publish[index].frame != ext) continue;
|
||||
if (publish[index].canid == rx_msg.identifier) {
|
||||
ESP_LOGI(TAG, "publish[%d] frame=%d canid=0x%x topic=[%s] topic_len=%d",
|
||||
ESP_LOGI(TAG, "publish[%d] frame=%d canid=0x%"PRIx32" topic=[%s] topic_len=%d",
|
||||
index, publish[index].frame, publish[index].canid, publish[index].topic, publish[index].topic_len);
|
||||
strcpy(frameBuf.topic, publish[index].topic);
|
||||
frameBuf.command = CMD_RECEIVE;
|
||||
@@ -94,7 +95,7 @@ void twai_task(void *pvParameters)
|
||||
|
||||
} else if (ret == ESP_ERR_TIMEOUT) {
|
||||
if (xQueueReceive(xQueue_twai_tx, &tx_msg, 0) == pdTRUE) {
|
||||
ESP_LOGI(TAG, "tx_msg.identifier=[0x%x] tx_msg.extd=%d", tx_msg.identifier, tx_msg.extd);
|
||||
ESP_LOGI(TAG, "tx_msg.identifier=[0x%"PRIx32"] tx_msg.extd=%d", tx_msg.identifier, tx_msg.extd);
|
||||
twai_status_info_t status_info;
|
||||
twai_get_status_info(&status_info);
|
||||
ESP_LOGD(TAG, "status_info.state=%d",status_info.state);
|
||||
@@ -102,8 +103,8 @@ void twai_task(void *pvParameters)
|
||||
ESP_LOGE(TAG, "TWAI driver not running %d", status_info.state);
|
||||
continue;
|
||||
}
|
||||
ESP_LOGD(TAG, "status_info.msgs_to_tx=%d",status_info.msgs_to_tx);
|
||||
ESP_LOGD(TAG, "status_info.msgs_to_rx=%d",status_info.msgs_to_rx);
|
||||
ESP_LOGD(TAG, "status_info.msgs_to_tx=%"PRIu32,status_info.msgs_to_tx);
|
||||
ESP_LOGD(TAG, "status_info.msgs_to_rx=%"PRIu32,status_info.msgs_to_rx);
|
||||
//esp_err_t ret = twai_transmit(&tx_msg, pdMS_TO_TICKS(10));
|
||||
esp_err_t ret = twai_transmit(&tx_msg, 0);
|
||||
if (ret == ESP_OK) {
|
||||
|
||||
Reference in New Issue
Block a user