address review comments

This commit is contained in:
ANTodorov 2024-11-17 22:07:58 +02:00
commit 34e317a9df
No known key found for this signature in database
GPG key ID: 318CC11D7ED4016B
2 changed files with 7 additions and 4 deletions

View file

@ -461,7 +461,7 @@ bool FlashDetect(bool flash_init) {
if (flash_init) { if (flash_init) {
if (!FlashInit()) { if (!FlashInit()) {
if (g_dbglevel > 3) Dbprintf("FlashDetect() FlashInit fail"); if (g_dbglevel > 3) Dbprintf("FlashDetect() FlashInit fail");
return 0; return false;
} }
} }
@ -483,6 +483,7 @@ bool FlashDetect(bool flash_init) {
if (flash_init) { if (flash_init) {
FlashStop(); FlashStop();
} }
return true; return true;
} }
@ -502,7 +503,9 @@ bool FlashInit(void) {
#ifndef AS_BOOTROM #ifndef AS_BOOTROM
if (spi_flash_p64k == 0) { if (spi_flash_p64k == 0) {
if (!FlashDetect(false)) return 0; if (!FlashDetect(false)) {
return false;
}
} }
#endif // #ifndef AS_BOOTROM #endif // #ifndef AS_BOOTROM

View file

@ -38,7 +38,7 @@
# define FLASH_MEM_MAX_SIZE 0x40000 // (262144) # define FLASH_MEM_MAX_SIZE 0x40000 // (262144)
#endif #endif
#ifndef FLASH_MEM_MAX_SIZE_P #ifndef FLASH_MEM_MAX_SIZE_P
# define FLASH_MEM_MAX_SIZE_P(p64k) (1024 * 64 * p64k) # define FLASH_MEM_MAX_SIZE_P(p64k) (1024 * 64 * (p64k))
#endif #endif
#ifndef FLASH_MEM_MAX_4K_SECTOR #ifndef FLASH_MEM_MAX_4K_SECTOR