Przeglądaj źródła

esp32: esp_err_to_name_r: print error code as hex and decimal

Ivan Grokhotkov 7 lat temu
rodzic
commit
6f40b528fa

+ 1 - 1
components/esp32/esp_err_to_name.c

@@ -473,7 +473,7 @@ const char *esp_err_to_name_r(esp_err_t code, char *buf, size_t buflen)
         return buf;
     }
 
-    snprintf(buf, buflen, "Unknown error %d", code);
+    snprintf(buf, buflen, "%s 0x%x(%d)", esp_unknown_msg, code, code);
 
     return buf;
 }

+ 1 - 1
components/esp32/esp_err_to_name.c.in

@@ -58,7 +58,7 @@ const char *esp_err_to_name_r(esp_err_t code, char *buf, size_t buflen)
         return buf;
     }
 
-    snprintf(buf, buflen, "Unknown error %d", code);
+    snprintf(buf, buflen, "%s 0x%x(%d)", esp_unknown_msg, code, code);
 
     return buf;
 }