diff options
| author | Jeff Epler <jepler@gmail.com> | 2021-03-16 12:21:50 -0500 |
|---|---|---|
| committer | Jeff Epler <jepler@gmail.com> | 2021-03-16 12:21:50 -0500 |
| commit | 58679dc038e475d7cd00ee45256b7f906ecc2240 (patch) | |
| tree | 30cbc3f9e7e4efc81a43f364d554f33c1df34169 /ports/raspberrypi/supervisor | |
| parent | 97b6664201de2530c9b92957a5e8d2a68524fa7e (diff) | |
| parent | bc690d4070c69e21d9070badc9f56a15d62ffb5d (diff) | |
Merge remote-tracking branch 'origin/main' into bitmap-read-2
Diffstat (limited to 'ports/raspberrypi/supervisor')
| -rw-r--r-- | ports/raspberrypi/supervisor/internal_flash.c | 14 | ||||
| -rw-r--r-- | ports/raspberrypi/supervisor/port.c | 14 |
2 files changed, 14 insertions, 14 deletions
diff --git a/ports/raspberrypi/supervisor/internal_flash.c b/ports/raspberrypi/supervisor/internal_flash.c index e8ee5cf1a..81f26967e 100644 --- a/ports/raspberrypi/supervisor/internal_flash.c +++ b/ports/raspberrypi/supervisor/internal_flash.c @@ -85,8 +85,8 @@ void port_internal_flash_flush(void) { mp_uint_t supervisor_flash_read_blocks(uint8_t *dest, uint32_t block, uint32_t num_blocks) { memcpy(dest, - (void*)(XIP_BASE + RESERVED_FLASH + block * FILESYSTEM_BLOCK_SIZE), - num_blocks * FILESYSTEM_BLOCK_SIZE); + (void *)(XIP_BASE + RESERVED_FLASH + block * FILESYSTEM_BLOCK_SIZE), + num_blocks * FILESYSTEM_BLOCK_SIZE); return 0; } @@ -100,18 +100,18 @@ mp_uint_t supervisor_flash_write_blocks(const uint8_t *src, uint32_t lba, uint32 if (_cache_lba != block_address) { memcpy(_cache, - (void*)(XIP_BASE + RESERVED_FLASH + sector_offset), - SECTOR_SIZE); + (void *)(XIP_BASE + RESERVED_FLASH + sector_offset), + SECTOR_SIZE); _cache_lba = sector_offset; } for (uint8_t b = block_offset; b < blocks_per_sector; b++) { // Stop copying after the last block. if (block >= num_blocks) { - break; + break; } memcpy(_cache + b * FILESYSTEM_BLOCK_SIZE, - src + block * FILESYSTEM_BLOCK_SIZE, - FILESYSTEM_BLOCK_SIZE); + src + block * FILESYSTEM_BLOCK_SIZE, + FILESYSTEM_BLOCK_SIZE); block++; } // Make sure we don't have an interrupt while we do flash operations. diff --git a/ports/raspberrypi/supervisor/port.c b/ports/raspberrypi/supervisor/port.c index 501a0c5ce..cf4c05f81 100644 --- a/ports/raspberrypi/supervisor/port.c +++ b/ports/raspberrypi/supervisor/port.c @@ -128,7 +128,8 @@ void reset_port(void) { void reset_to_bootloader(void) { reset_usb_boot(0, 0); - while (true) {} + while (true) { + } } void reset_cpu(void) { @@ -172,7 +173,7 @@ uint32_t port_get_saved_word(void) { return watchdog_hw->scratch[0]; } -uint64_t port_get_raw_ticks(uint8_t* subticks) { +uint64_t port_get_raw_ticks(uint8_t *subticks) { uint64_t microseconds = time_us_64(); return 1024 * (microseconds / 1000000) + (microseconds % 1000000) / 977; } @@ -210,16 +211,15 @@ void port_idle_until_interrupt(void) { /** * \brief Default interrupt handler for unused IRQs. */ -__attribute__((used)) void HardFault_Handler(void) -{ -#ifdef ENABLE_MICRO_TRACE_BUFFER +__attribute__((used)) void HardFault_Handler(void) { + #ifdef ENABLE_MICRO_TRACE_BUFFER // Turn off the micro trace buffer so we don't fill it up in the infinite // loop below. REG_MTB_MASTER = 0x00000000 + 6; -#endif + #endif reset_into_safe_mode(HARD_CRASH); while (true) { - asm("nop;"); + asm ("nop;"); } } |
