mirror of https://github.com/wolfSSL/wolfBoot.git
fix reviewer's comments
parent
16c160146f
commit
1b9ec09b1a
10
hal/hal.c
10
hal/hal.c
|
@ -189,8 +189,6 @@ int hal_flash_test_dualbank(void)
|
|||
uint8_t cur_fill = 0xb0;
|
||||
uint8_t new_fill = 0xf0;
|
||||
uint8_t fill;
|
||||
uint32_t bankA = TEST_ADDRESS_BANKA;
|
||||
uint32_t bankB = TEST_ADDRESS_BANKB;
|
||||
uint32_t pagePtr;
|
||||
|
||||
wolfBoot_printf("swap flash test at 0x%x\n", TEST_ADDRESS);
|
||||
|
@ -219,21 +217,21 @@ int hal_flash_test_dualbank(void)
|
|||
}
|
||||
|
||||
if (*((uint8_t*)(TEST_ADDRESS_BANKA)) != cur_fill) {
|
||||
wolfBoot_printf("Bank A data mismatch: %x != %x\n", bankA[0], cur_fill);
|
||||
wolfBoot_printf("Bank A data mismatch: %x != %x\n", *((uint8_t*)TEST_ADDRESS_BANKA), cur_fill);
|
||||
return -1;
|
||||
}
|
||||
if (*((uint8_t*)(TEST_ADDRESS_BANKB)) != new_fill) {
|
||||
wolfBoot_printf("Bank B data mismatch: %x != %x\n", bankB[0], new_fill);
|
||||
wolfBoot_printf("Bank B data mismatch: %x != %x\n", *((uint8_t*)TEST_ADDRESS_BANKB), new_fill);
|
||||
return -1;
|
||||
}
|
||||
hal_flash_dualbank_swap();
|
||||
|
||||
if (*((uint8_t*)(TEST_ADDRESS_BANKA)) != new_fill) {
|
||||
wolfBoot_printf("Bank A data mismatch after swap: %x != %x\n", bankA[0], new_fill);
|
||||
wolfBoot_printf("Bank A data mismatch after swap: %x != %x\n", *((uint8_t*)TEST_ADDRESS_BANKA), new_fill);
|
||||
return -1;
|
||||
}
|
||||
if (*((uint8_t*)(TEST_ADDRESS_BANKB)) != cur_fill) {
|
||||
wolfBoot_printf("Bank B data mismatch after swap: %x != %x\n", bankB[0], cur_fill);
|
||||
wolfBoot_printf("Bank B data mismatch after swap: %x != %x\n", *((uint8_t*)TEST_ADDRESS_BANKB), cur_fill);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ void hal_flash_dualbank_swap(void)
|
|||
void hal_init(void)
|
||||
{
|
||||
#if defined(TEST_CLOCK)
|
||||
/* toogle led at 1hz for 10sec */
|
||||
/* toggle led at 1hz for 10sec */
|
||||
pic32_clock_test(48000000U);
|
||||
#endif
|
||||
pic32_clock_fracdiv0_set(0, 0);
|
||||
|
@ -63,7 +63,7 @@ void hal_init(void)
|
|||
while (1) {}
|
||||
#endif
|
||||
#if defined(TEST_CLOCK)
|
||||
/* toogle led at 1hz */
|
||||
/* toggle led at 1hz */
|
||||
pic32_clock_test(120000000U);
|
||||
pic32_clock_reset();
|
||||
pic32_clock_test(48000000U);
|
||||
|
|
|
@ -27,4 +27,4 @@
|
|||
#define GCLK_BASE (0x44010000U)
|
||||
#define MCLK_BASE (0x44012000U)
|
||||
|
||||
#endif /* PIC32CZ_REGISTERS_H */
|
||||
#endif /* PIC32CK_REGISTERS_H */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* app_pic32cz.c
|
||||
/* app_pic32ck.c
|
||||
*
|
||||
* Test bare-metal boot-led-on application
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue