any_queued_interrupts was also set to false if scanned for higher ("lower"?) level
This commit is contained in:
parent
2fc6c3eeb5
commit
50d126ea87
1 changed files with 10 additions and 4 deletions
14
cpu.cpp
14
cpu.cpp
|
@ -349,15 +349,23 @@ bool cpu::execute_any_pending_interrupt()
|
||||||
std::unique_lock<std::mutex> lck(qi_lock);
|
std::unique_lock<std::mutex> lck(qi_lock);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
any_queued_interrupts = false;
|
||||||
|
|
||||||
uint8_t current_level = getPSW_spl();
|
uint8_t current_level = getPSW_spl();
|
||||||
|
|
||||||
// uint8_t start_level = current_level <= 3 ? 0 : current_level + 1;
|
// uint8_t start_level = current_level <= 3 ? 0 : current_level + 1;
|
||||||
uint8_t start_level = current_level + 1;
|
// uint8_t start_level = current_level + 1;
|
||||||
|
uint8_t start_level = current_level;
|
||||||
|
|
||||||
for(uint8_t i=start_level; i < 8; i++) {
|
for(uint8_t i=0; i < 8; i++) {
|
||||||
auto interrupts = queued_interrupts.find(i);
|
auto interrupts = queued_interrupts.find(i);
|
||||||
|
|
||||||
if (interrupts->second.empty() == false) {
|
if (interrupts->second.empty() == false) {
|
||||||
|
any_queued_interrupts = true;
|
||||||
|
|
||||||
|
if (i < start_level)
|
||||||
|
continue;
|
||||||
|
|
||||||
auto vector = interrupts->second.begin();
|
auto vector = interrupts->second.begin();
|
||||||
|
|
||||||
uint8_t v = *vector;
|
uint8_t v = *vector;
|
||||||
|
@ -376,8 +384,6 @@ bool cpu::execute_any_pending_interrupt()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
any_queued_interrupts = false;
|
|
||||||
|
|
||||||
#if defined(BUILD_FOR_RP2040)
|
#if defined(BUILD_FOR_RP2040)
|
||||||
xSemaphoreGive(qi_lock);
|
xSemaphoreGive(qi_lock);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue