Skip to content

Commit

Permalink
FuriHal: allow nulling null isr (#2846)
Browse files Browse the repository at this point in the history
* FuriHal: allow nulling null isr
* FuriHal: include interrupt priority 15 as allowed
* Furi: prevent compiler from optimizing arg in r0 of RESTORE_REGISTERS_AND_HALT_MCU
  • Loading branch information
skotopes authored Jul 5, 2023
1 parent 97fbd84 commit f3ae09c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions firmware/targets/f7/furi_hal/furi_hal_interrupt.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,13 @@ void furi_hal_interrupt_set_isr_ex(
FuriHalInterruptISR isr,
void* context) {
furi_check(index < FuriHalInterruptIdMax);
furi_check(priority < 15);
furi_check(priority <= 15);

if(isr) {
// Pre ISR set
furi_check(furi_hal_interrupt_isr[index].isr == NULL);
} else {
// Pre ISR clear
furi_check(furi_hal_interrupt_isr[index].isr != NULL);
furi_hal_interrupt_disable(index);
furi_hal_interrupt_clear_pending(index);
}
Expand Down
2 changes: 1 addition & 1 deletion furi/core/check.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ PLACE_IN_SECTION("MB_MEM2") uint32_t __furi_check_registers[13] = {0};
*
*/
#define RESTORE_REGISTERS_AND_HALT_MCU(debug) \
register const bool r0 asm("r0") = debug; \
register bool r0 asm("r0") = debug; \
asm volatile("cbnz r0, with_debugger%= \n" \
"ldr r12, =__furi_check_registers\n" \
"ldm r12, {r0-r11} \n" \
Expand Down

0 comments on commit f3ae09c

Please sign in to comment.