diff --git a/esp-riscv-rt/src/lib.rs b/esp-riscv-rt/src/lib.rs index a7f344327..4808cefd3 100644 --- a/esp-riscv-rt/src/lib.rs +++ b/esp-riscv-rt/src/lib.rs @@ -721,12 +721,12 @@ r#" "#, // store current priority, set threshold, enable interrupts r#" - addi sp, sp, -4 #build stack + addi sp, sp, -16 #build stack sw ra, 0(sp) jal ra, _handle_priority lw ra, 0(sp) sw a0, 0(sp) #reuse old stack, a0 is return of _handle_priority - addi a0, sp, 4 #the proper stack pointer is an argument to the HAL handler + addi a0, sp, 16 #the proper stack pointer is an argument to the HAL handler "#, // jump to handler loaded in direct handler r#" @@ -736,7 +736,7 @@ r#" r#" lw a0, 0(sp) #load stored priority jal ra, _restore_priority - addi sp, sp, 4 #pop + addi sp, sp, 16 #pop "#, r#" lw t1, 31*4(sp)