MEGA2560 didn't compile correctly

This commit is contained in:
bsongis
2014-12-08 20:20:13 +01:00
parent 2c591e810d
commit 4c2c85fe9f
9 changed files with 80 additions and 72 deletions
+21 -17
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))
@@ -169,30 +169,34 @@ void sdPoll10ms();
#define DBLKEYS_PRESSED_LFT_DWN(i) ((in & ((1<<INP_L_KEY_LFT) + (1<<INP_L_KEY_DWN))) == ((1<<INP_L_KEY_LFT) + (1<<INP_L_KEY_DWN)))
// LCD driver
#define PORTA_LCD_DAT PORTA
#define PORTC_LCD_CTRL PORTC
#define OUT_C_LCD_E 5
#define OUT_C_LCD_RnW 4
#define OUT_C_LCD_A0 3
#define OUT_C_LCD_RES 2
#define OUT_C_LCD_CS1 1
#define PORTA_LCD_DAT PORTA
#define PORTC_LCD_CTRL PORTC
#define OUT_C_LCD_E 5
#define OUT_C_LCD_RnW 4
#define OUT_C_LCD_A0 3
#define OUT_C_LCD_RES 2
#define OUT_C_LCD_CS1 1
// Power driver
uint8_t pwrCheck();
void pwrOff();
#define UNEXPECTED_SHUTDOWN() ((mcusr & (1 << WDRF)) || g_eeGeneral.unexpectedShutdown)
#define UNEXPECTED_SHUTDOWN() ((mcusr & (1 << WDRF)) || g_eeGeneral.unexpectedShutdown)
// USB fake driver
#define usbPlugged() false
#define usbPlugged() false
// Haptic driver
#define hapticOff() // TODO hapticOn() cleaner ...
#define HAPTIC_ON() PORTD &= ~(1 << OUT_D_HAPTIC)
#define HAPTIC_OFF() PORTD |= (1 << OUT_D_HAPTIC)
#define hapticOff() // TODO hapticOn() cleaner ...
#define HAPTIC_ON() PORTD &= ~(1 << OUT_D_HAPTIC)
#define HAPTIC_OFF() PORTD |= (1 << OUT_D_HAPTIC)
// Rotary encoder driver
#define REA_DOWN() (~PIND & 0x20)
#define REB_DOWN() (~PIND & 0x10)
#define ROTENC_DOWN() (REA_DOWN() || REB_DOWN())
#define REA_DOWN() (~PIND & 0x20)
#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
+6 -2
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
+16 -12
View File
@@ -210,21 +210,21 @@ void backlightFade();
#define INP_G_RuddDR 0
// Keys driver
#define TRIMS_PRESSED() (~PIND)
#define KEYS_PRESSED() (~PINB)
#define TRIMS_PRESSED() (~PIND)
#define KEYS_PRESSED() (~PINB)
#define DBLKEYS_PRESSED_RGT_LFT(i) ((in & ((1<<INP_B_KEY_RGT) + (1<<INP_B_KEY_LFT))) == ((1<<INP_B_KEY_RGT) + (1<<INP_B_KEY_LFT)))
#define DBLKEYS_PRESSED_UP_DWN(i) ((in & ((1<<INP_B_KEY_UP) + (1<<INP_B_KEY_DWN))) == ((1<<INP_B_KEY_UP) + (1<<INP_B_KEY_DWN)))
#define DBLKEYS_PRESSED_RGT_UP(i) ((in & ((1<<INP_B_KEY_RGT) + (1<<INP_B_KEY_UP))) == ((1<<INP_B_KEY_RGT) + (1<<INP_B_KEY_UP)))
#define DBLKEYS_PRESSED_LFT_DWN(i) ((in & ((1<<INP_B_KEY_LFT) + (1<<INP_B_KEY_DWN))) == ((1<<INP_B_KEY_LFT) + (1<<INP_B_KEY_DWN)))
// LCD driver
#define PORTA_LCD_DAT PORTA
#define PORTC_LCD_CTRL PORTC
#define OUT_C_LCD_E 5
#define OUT_C_LCD_RnW 4
#define OUT_C_LCD_A0 3
#define OUT_C_LCD_RES 2
#define OUT_C_LCD_CS1 1
#define PORTA_LCD_DAT PORTA
#define PORTC_LCD_CTRL PORTC
#define OUT_C_LCD_E 5
#define OUT_C_LCD_RnW 4
#define OUT_C_LCD_A0 3
#define OUT_C_LCD_RES 2
#define OUT_C_LCD_CS1 1
// Rotary encoder driver
#if defined(ROTARY_ENCODER_NAVIGATION)
@@ -233,10 +233,14 @@ void rotencPoll();
#endif
// Haptic
#define HAPTIC_ON() PORTG |= (1 << OUT_G_HAPTIC)
#define HAPTIC_OFF() PORTG &= ~(1 << OUT_G_HAPTIC)
#define HAPTIC_ON() PORTG |= (1 << OUT_G_HAPTIC)
#define HAPTIC_OFF() PORTG &= ~(1 << OUT_G_HAPTIC)
// USB fake driver
#define usbPlugged() false
#define usbPlugged() false
// Buzzer driver
#define buzzerOn() PORTE |= (1 << OUT_E_BUZZER)
#define buzzerOff() PORTE &= ~(1 << OUT_E_BUZZER)
#endif