1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-23 16:25:16 +03:00

MEGA2560 didn't compile correctly

This commit is contained in:
bsongis 2014-12-08 20:17:30 +01:00
parent 2c591e810d
commit 4c2c85fe9f
9 changed files with 80 additions and 72 deletions

View file

@ -57,13 +57,13 @@ void audioQueue::heartbeat()
#else
if (toneTimeLeft > 0) {
if (toneFreq == 0) { //pause only events
SPEAKER_OFF;
speakerOff();
}
else {
#if defined(PCBGRUVIN9X)
if (toneFreq) {
OCR0A = (5000 / toneFreq); // sticking with old values approx 20(abs. min) to 90, 60 being the default tone(?).
SPEAKER_ON;
speakerOn();
}
#endif
toneFreq += toneFreqIncr;
@ -72,7 +72,7 @@ void audioQueue::heartbeat()
}
else {
if (tonePause > 0) {
SPEAKER_OFF;
speakerOff();
tonePause--; //time gets counted down
}
else if (t_queueRidx != t_queueWidx) {
@ -89,7 +89,7 @@ void audioQueue::heartbeat()
#if defined(PCBGRUVIN9X)
if (tone2Freq) {
OCR0A = (5000 / tone2Freq); // sticking with old values approx 20(abs. min) to 90, 60 being the default tone(?).
SPEAKER_ON;
speakerOn();
}
#else
toneFreq = tone2Freq;
@ -97,7 +97,7 @@ void audioQueue::heartbeat()
tone2TimeLeft--; //time gets counted down
}
else {
SPEAKER_OFF;
speakerOff();
}
}
}

View file

@ -38,8 +38,8 @@
#define audio_h
#if defined(PCBSTD)
#define SPEAKER_ON BUZZER_ON
#define SPEAKER_OFF toneFreq=0; BUZZER_OFF
#define speakerOn() buzzerOn()
#define speakerOff() toneFreq=0; buzzerOff()
#endif
//audio
@ -66,9 +66,9 @@ class audioQueue
if (toneFreq) {
toneCounter += toneFreq;
if ((toneCounter & 0x80) == 0x80)
BUZZER_ON;
buzzerOn();
else
BUZZER_OFF;
buzzerOff();
}
}

View file

@ -121,8 +121,7 @@ inline void BUZZER_HEARTBEAT()
}
g_beepCnt--;
}
else
{
else {
if (beepAgain && beepAgainOrig) {
beepOn = !beepOn;
g_beepCnt = beepOn ? beepAgainOrig : 8;
@ -138,12 +137,12 @@ inline void BUZZER_HEARTBEAT()
if (beepOn) {
warbleC = warble && !warbleC;
if (warbleC)
BUZZER_OFF;
buzzerOff();
else
BUZZER_ON;
buzzerOn();
}
else {
BUZZER_OFF;
buzzerOff();
}
}
#endif

View file

@ -4830,7 +4830,7 @@ void menuModelLogicalSwitches(uint8_t event)
// CSW name
uint8_t sw = SWSRC_SW1+k;
putsSwitches(0, y, sw, (getSwitch(sw) ? BOLD : 0) | ((sub==k && horz<0) ? INVERS : 0));
putsSwitches(0, y, sw, (getSwitch(sw) ? BOLD : 0) | ((sub==k && CURSOR_ON_LINE()) ? INVERS : 0));
// CSW func
lcd_putsiAtt(CSW_1ST_COLUMN, y, STR_VCSWFUNC, cs->func, horz==0 ? attr : 0);

View file

@ -274,7 +274,7 @@ int8_t checkIncDecGen(uint8_t event, int8_t i_val, int8_t i_min, int8_t i_max);
#if defined(PCBTARANIS)
#define NAVIGATION_LINE_BY_LINE 0x40
#define CURSOR_ON_LINE() m_posHorz<0
#define CURSOR_ON_LINE() (m_posHorz<0)
#else
#define NAVIGATION_LINE_BY_LINE 0
#define CURSOR_ON_LINE() (0)

View file

@ -977,9 +977,6 @@ void checkBacklight();
#define BACKLIGHT_OFF() __BACKLIGHT_OFF
#endif
#define BUZZER_ON PORTE |= (1 << OUT_E_BUZZER)
#define BUZZER_OFF PORTE &= ~(1 << OUT_E_BUZZER)
#define BITMASK(bit) (1<<(bit))
/// liefert Dimension eines Arrays

View file

@ -94,8 +94,8 @@ void sdPoll10ms();
#define SD_GET_SPEED() (0)
#endif
#define SPEAKER_ON TCCR0A |= (1 << COM0A0)
#define SPEAKER_OFF TCCR0A &= ~(1 << COM0A0)
#define speakerOn() TCCR0A |= (1 << COM0A0)
#define speakerOff() TCCR0A &= ~(1 << COM0A0)
#define __BACKLIGHT_ON PORTC |= (1 << OUT_C_LIGHT)
#define __BACKLIGHT_OFF PORTC &= ~(1 << OUT_C_LIGHT)
#define IS_BACKLIGHT_ON() (PORTC & (1<<OUT_C_LIGHT))
@ -195,4 +195,8 @@ void pwrOff();
#define REB_DOWN() (~PIND & 0x10)
#define ROTENC_DOWN() (REA_DOWN() || REB_DOWN())
// Buzzer driver
#define buzzerOn() PORTE |= (1 << OUT_E_BUZZER)
#define buzzerOff() PORTE &= ~(1 << OUT_E_BUZZER)
#endif

View file

@ -82,8 +82,8 @@
#define SLAVE_MODE() (PINH & (1<<INP_H_RF_POW)) //not tested
#define JACK_PPM_OUT() PORTB |= (1<<OUT_B_SIM_CTL) //not tested
#define JACK_PPM_IN() PORTB &= ~(1<<OUT_B_SIM_CTL) //not tested
#define SPEAKER_ON TCCR0A |= (1 << COM0A0) //not tested
#define SPEAKER_OFF TCCR0A &= ~(1 << COM0A0) //not tested
#define speakerOn() TCCR0A |= (1 << COM0A0) //not tested
#define speakerOff() TCCR0A &= ~(1 << COM0A0) //not tested
#define __BACKLIGHT_ON PORTC |= (1 << OUT_C_LIGHT) //ok
#define __BACKLIGHT_OFF PORTC &= ~(1 << OUT_C_LIGHT) //ok
@ -192,4 +192,8 @@ void pwrOff();
// Haptic driver
#define hapticOff() // TODO hapticOn() cleaner ...
// Buzzer driver
#define buzzerOn() PORTB |= (1 << OUT_B_BUZZER)
#define buzzerOff() PORTB &= ~(1 << OUT_B_BUZZER)
#endif

View file

@ -239,4 +239,8 @@ void rotencPoll();
// USB fake driver
#define usbPlugged() false
// Buzzer driver
#define buzzerOn() PORTE |= (1 << OUT_E_BUZZER)
#define buzzerOff() PORTE &= ~(1 << OUT_E_BUZZER)
#endif