protect set_channel and set_power from interrupts.
This commit is contained in:
parent
2aa76aaacd
commit
092a182a5d
|
@ -752,6 +752,8 @@ const uint32_t AIMVAL[19] = {
|
||||||
#define ADDR_POW2 ADDR_POW1 + 12
|
#define ADDR_POW2 ADDR_POW1 + 12
|
||||||
#define ADDR_POW3 ADDR_POW1 + 64
|
#define ADDR_POW3 ADDR_POW1 + 64
|
||||||
void set_power(uint8_t power) {
|
void set_power(uint8_t power) {
|
||||||
|
safe_irq_disable(MACA);
|
||||||
|
|
||||||
reg(ADDR_POW1) = PSMVAL[power];
|
reg(ADDR_POW1) = PSMVAL[power];
|
||||||
|
|
||||||
/* see http://devl.org/pipermail/mc1322x/2009-October/000065.html */
|
/* see http://devl.org/pipermail/mc1322x/2009-October/000065.html */
|
||||||
|
@ -763,6 +765,8 @@ void set_power(uint8_t power) {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
reg(ADDR_POW3) = AIMVAL[power];
|
reg(ADDR_POW3) = AIMVAL[power];
|
||||||
|
|
||||||
|
irq_restore();
|
||||||
}
|
}
|
||||||
|
|
||||||
const uint8_t VCODivI[16] = {
|
const uint8_t VCODivI[16] = {
|
||||||
|
@ -810,6 +814,7 @@ const uint32_t VCODivF[16] = {
|
||||||
#define ADDR_CHAN4 (ADDR_CHAN1+48)
|
#define ADDR_CHAN4 (ADDR_CHAN1+48)
|
||||||
void set_channel(uint8_t chan) {
|
void set_channel(uint8_t chan) {
|
||||||
volatile uint32_t tmp;
|
volatile uint32_t tmp;
|
||||||
|
safe_irq_disable(MACA);
|
||||||
|
|
||||||
tmp = reg(ADDR_CHAN1);
|
tmp = reg(ADDR_CHAN1);
|
||||||
tmp = tmp & 0xbfffffff;
|
tmp = tmp & 0xbfffffff;
|
||||||
|
@ -830,6 +835,7 @@ void set_channel(uint8_t chan) {
|
||||||
tmp = tmp | (((ctov[chan])<<8)&0x1F00);
|
tmp = tmp | (((ctov[chan])<<8)&0x1F00);
|
||||||
reg(ADDR_CHAN4) = tmp;
|
reg(ADDR_CHAN4) = tmp;
|
||||||
/* duh! */
|
/* duh! */
|
||||||
|
irq_restore();
|
||||||
}
|
}
|
||||||
|
|
||||||
#define ROM_END 0x0013ffff
|
#define ROM_END 0x0013ffff
|
||||||
|
|
Loading…
Reference in New Issue