Ensure only GIE bit is touched in splx_()
This commit is contained in:
parent
07b170595c
commit
892268d74b
@ -82,7 +82,7 @@ enum lpm_mode lpm_set(enum lpm_mode target)
|
|||||||
case LPM_OFF:
|
case LPM_OFF:
|
||||||
/* MCU totally down (LPM4), only RESET or NMI can resume execution */
|
/* MCU totally down (LPM4), only RESET or NMI can resume execution */
|
||||||
__bis_status_register(CPUOFF | OSCOFF | SCG0 | SCG1);
|
__bis_status_register(CPUOFF | OSCOFF | SCG0 | SCG1);
|
||||||
/* all blocks off */
|
/* all blocks off */
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
printf("ERROR: trying to set an invalid low-power mode!\n");
|
printf("ERROR: trying to set an invalid low-power mode!\n");
|
||||||
|
|||||||
@ -170,6 +170,7 @@ splhigh_(void)
|
|||||||
void
|
void
|
||||||
splx_(int sr)
|
splx_(int sr)
|
||||||
{
|
{
|
||||||
|
sr &= GIE;
|
||||||
/* If GIE was set, restore it. */
|
/* If GIE was set, restore it. */
|
||||||
asmv("bis %0, r2" : : "r"(sr));
|
asmv("bis %0, r2" : : "r"(sr));
|
||||||
asmv("nop");
|
asmv("nop");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user