mirror of
https://github.com/halleysfifthinc/AVCLAN-Mockingboard.git
synced 2026-08-07 01:13:18 +00:00
Use ATOMIC_BLOCK instead of manual cli/sei
This commit is contained in:
+3
-2
@@ -92,6 +92,7 @@
|
|||||||
#include <avr/interrupt.h>
|
#include <avr/interrupt.h>
|
||||||
#include <avr/io.h>
|
#include <avr/io.h>
|
||||||
#include <avr/sfr_defs.h>
|
#include <avr/sfr_defs.h>
|
||||||
|
#include <util/atomic.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@@ -233,11 +234,11 @@ void AVCLAN_muteDevice(uint8_t mute) {
|
|||||||
// 1 sec)
|
// 1 sec)
|
||||||
void AVCLAN_startPlaying() {
|
void AVCLAN_startPlaying() {
|
||||||
CD_Mode = stPlay;
|
CD_Mode = stPlay;
|
||||||
cli();
|
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
|
||||||
loop_until_bit_is_clear(RTC_PITSTATUS, RTC_CNTBUSY_bp);
|
loop_until_bit_is_clear(RTC_PITSTATUS, RTC_CNTBUSY_bp);
|
||||||
RTC.CNT = 0;
|
RTC.CNT = 0;
|
||||||
sbi(RTC.PITINTCTRL, RTC_PI_bp);
|
sbi(RTC.PITINTCTRL, RTC_PI_bp);
|
||||||
sei();
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sets CD_mode to play and resets timer count (so that the next interrupt is in
|
// Sets CD_mode to play and resets timer count (so that the next interrupt is in
|
||||||
|
|||||||
Reference in New Issue
Block a user