msp430: set SR on exit when in ISR

master
Clyne 1 year ago
parent 8e7cb05cfb
commit d6ee894c13
Signed by: clyne
GPG Key ID: 1B74EE6C49C96795

@ -48,6 +48,7 @@ static void Software_Trim();
//__attribute__((section(".hidict"))) //__attribute__((section(".hidict")))
//static uint8_t hidict[16384]; //static uint8_t hidict[16384];
static bool inISR = false;
static Addr isr_list[24] = {}; static Addr isr_list[24] = {};
static SplitMemDictRW<sizeof(alee_dat), 16384> dict (alee_dat, 0x10000); static SplitMemDictRW<sizeof(alee_dat), 16384> dict (alee_dat, 0x10000);
@ -180,10 +181,16 @@ void user_sys(State& state)
state.push(*reinterpret_cast<uint16_t *>(state.pop())); state.push(*reinterpret_cast<uint16_t *>(state.pop()));
break; break;
case 15: case 15:
if (!inISR)
_bis_SR_register(state.pop()); _bis_SR_register(state.pop());
else
_bis_SR_register_on_exit(state.pop());
break; break;
case 16: case 16:
if (!inISR)
_bic_SR_register(state.pop()); _bic_SR_register(state.pop());
else
_bic_SR_register_on_exit(state.pop());
break; break;
default: default:
break; break;
@ -368,7 +375,9 @@ void alee_isr_handle(unsigned index)
if (isr != 0) { if (isr != 0) {
State isrstate (dict, readchar); State isrstate (dict, readchar);
inISR = true;
isrstate.execute(isr); isrstate.execute(isr);
inISR = false;
} }
} }

Loading…
Cancel
Save