Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion platform/fm1.c
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ void fm1_cstart(void) {
if (boot_mode == BOOT_RECOVERY || recovery_key()) {
recovery_main(); /* OCT- at power-on: the USB rescue */
}
flash_ok = FL_FAR(fl_jedec_ram)() == 0x856014u;
flash_ok = FL_JEDEC_OK(FL_FAR(fl_jedec_ram)());
ota_boot_cleanup();
lcd_init();
lcd_fill(0, 0, 240, 240, C_BLACK);
Expand Down
3 changes: 2 additions & 1 deletion platform/hal/fm1_flash.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ static inline void *fl_far(void *p) { void *volatile q = p; return q; }
#define T4_CNT REG32(0x10804u) /* TIMER4, 24 MHz free-running */

#define FL_XIP(off) FM1_XIP(off) /* fm1_xip.h */
#define FL_JEDEC_OK(id) ((id) == 0x856014u || (id) == 0xB36014u) /* the FM-1's part up to 2026, the newer FM-1s' */
#define FL_DATA_LO 0x00097000u /* Felucca main store */
#define FL_DATA_HI 0x000E0000u
#define FL_GLOB_LO 0x000FC000u /* Felucca superblock / globals */
Expand Down Expand Up @@ -143,7 +144,7 @@ RAMINL int fl_wait_ready(uint32_t max_us, uint32_t *took_us)

/* ---- entry points: IRQs OFF, args/buffers in RAM ---- */

static RAMFN uint32_t fl_jedec_ram(void) /* expect 0x856014 */
static RAMFN uint32_t fl_jedec_ram(void) /* FL_JEDEC_OK */
{
fl_saved_t s; uint32_t id;
if (fl_enter(&s)) return 0;
Expand Down
2 changes: 1 addition & 1 deletion platform/loader/loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ static void ldr_record_clear(void)
{
fm1_updata_parm_clear(); /* CRC 0: the SPL ignores it on a warm reset */
}
static int ldr_flash_known(void) { return fl_jedec_ram() == 0x856014u; } /* as the app (project.c) */
static int ldr_flash_known(void) { return FL_JEDEC_OK(fl_jedec_ram()); } /* as the app (fm1.c) */
static void ldr_progress(uint32_t done, uint32_t total) { (void)done; (void)total; ldr_poll(); }
#include "ldr_core.c"

Expand Down
2 changes: 1 addition & 1 deletion platform/src/recovery.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ static void recovery_main(void)
recovery_last = recovery_usb_last = fm1_ticks();
recovery_fraction = fm1_ms = 0;
/* No persist_boot or OTA cleanup: no flash write just for entering rescue. */
flash_ok = FL_FAR(fl_jedec_ram)() == 0x856014u;
flash_ok = FL_JEDEC_OK(FL_FAR(fl_jedec_ram)());
lcd_init();
lcd_fill(0, 0, 240, 240, C_BLACK);
draw_text_box(0, 64, 240, &FONT_S, APP_NAME " USB RESCUE", C_WHITE, 1);
Expand Down
Loading