Fixed abort message not shown in the intercepted panic log

This commit is contained in:
Alex Duchesne 2021-03-04 23:31:57 -05:00
parent e696de2975
commit 2111671c3e
2 changed files with 26 additions and 9 deletions

View File

@ -213,7 +213,7 @@ void emulator_crc32_file(retro_emulator_file_t *file)
const size_t chunk_size = 32768;
const char *file_path = emu_get_file_path(file);
char *cache_path = rg_emu_get_path(EMU_PATH_CRC_CACHE, file_path);
FILE *fp, *fp2;
FILE *fp;
file->missing_cover = 0;
@ -224,9 +224,10 @@ void emulator_crc32_file(retro_emulator_file_t *file)
}
else if ((fp = fopen(file_path, "rb")) != NULL)
{
uint8_t *buffer = rg_alloc(chunk_size, MEM_ANY);
void *buffer = rg_alloc(chunk_size, MEM_ANY);
size_t count = 0;
bool done = false;
uint32_t crc_tmp = 0;
uint32_t count = 0;
gui_draw_notice(" CRC32", C_GREEN);
@ -244,19 +245,20 @@ void emulator_crc32_file(retro_emulator_file_t *file)
crc_tmp = crc32_le(crc_tmp, buffer, count);
if (count < chunk_size) break;
}
done = feof(fp);
fclose(fp);
rg_free(buffer);
if (feof(fp))
if (done)
{
file->checksum = crc_tmp;
if ((fp2 = fopen(cache_path, "wb")) != NULL)
if ((fp = fopen(cache_path, "wb")) != NULL)
{
fwrite(&file->checksum, 4, 1, fp2);
fclose(fp2);
fwrite(&file->checksum, 4, 1, fp);
fclose(fp);
}
}
fclose(fp);
}
else
{

View File

@ -15,4 +15,19 @@
+ esp_panic_putchar_hook(c);
}
static void panicPutStr(const char *c)
static void panicPutStr(const char *c)
@@ -160,9 +165,11 @@ static __attribute__((noreturn)) inline void invoke_abort()
void abort()
{
-#if !CONFIG_ESP32_PANIC_SILENT_REBOOT
- ets_printf("abort() was called at PC 0x%08x on core %d\r\n", (intptr_t)__builtin_return_address(0) - 3, xPortGetCoreID());
-#endif
+ panicPutStr("abort() was called at PC 0x");
+ panicPutHex(__builtin_return_address(0) - 3);
+ panicPutStr(" on core ");
+ panicPutDec(xPortGetCoreID());
+ panicPutStr("\r\n");
/* Calling code might have set other reset reason hint (such as Task WDT),
* don't overwrite that.
*/