M2560 update
makefile option for soft-off and haptic added audio&voice desactivated on Companion (not yet implemented) doc update (LCD resistor added)
This commit is contained in:
@@ -1256,6 +1256,7 @@ void registerOpenTxFirmwares()
|
|||||||
/* MEGA2560 board */
|
/* MEGA2560 board */
|
||||||
openTx = new OpenTxFirmware("opentx-mega2560", QObject::tr("OpenTX for MEGA2560 board"), BOARD_MEGA2560);
|
openTx = new OpenTxFirmware("opentx-mega2560", QObject::tr("OpenTX for MEGA2560 board"), BOARD_MEGA2560);
|
||||||
addOpenTxLcdOptions(openTx);
|
addOpenTxLcdOptions(openTx);
|
||||||
|
openTx->addOption("PWR", QObject::tr("Power management by soft-off circuitry"));
|
||||||
openTx->addOptions(ext_options);
|
openTx->addOptions(ext_options);
|
||||||
openTx->addOption("PXX", QObject::tr("Support of FrSky PXX protocol"));
|
openTx->addOption("PXX", QObject::tr("Support of FrSky PXX protocol"));
|
||||||
openTx->addOptions(dsm2_options);
|
openTx->addOptions(dsm2_options);
|
||||||
@@ -1264,7 +1265,9 @@ void registerOpenTxFirmwares()
|
|||||||
openTx->addOption("nofp", QObject::tr("No flight modes"));
|
openTx->addOption("nofp", QObject::tr("No flight modes"));
|
||||||
openTx->addOption("nocurves", QObject::tr("Disable curves menus"));
|
openTx->addOption("nocurves", QObject::tr("Disable curves menus"));
|
||||||
openTx->addOption("sdcard", QObject::tr("Support for SD memory card"));
|
openTx->addOption("sdcard", QObject::tr("Support for SD memory card"));
|
||||||
openTx->addOption("voice", QObject::tr("Used if you have voice module"));
|
//openTx->addOption("audio", QObject::tr("Support for radio modified with regular speaker"));
|
||||||
|
//openTx->addOption("voice", QObject::tr("Used if you have modified your radio with voice mode"));
|
||||||
|
openTx->addOption("haptic", QObject::tr("Used if you have modified your radio with haptic mode"));
|
||||||
openTx->addOption("ppmca", QObject::tr("PPM center adjustment in limits"));
|
openTx->addOption("ppmca", QObject::tr("PPM center adjustment in limits"));
|
||||||
openTx->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT);
|
openTx->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT);
|
||||||
openTx->addOption("symlimits", QObject::tr("Symetrical Limits"));
|
openTx->addOption("symlimits", QObject::tr("Symetrical Limits"));
|
||||||
|
|||||||
+510
-473
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@@ -692,6 +692,7 @@ ifeq ($(PCB), MEGA2560)
|
|||||||
SDCARD = NO
|
SDCARD = NO
|
||||||
BUZZER = YES
|
BUZZER = YES
|
||||||
THR_TRACE = YES
|
THR_TRACE = YES
|
||||||
|
PWRMANAGE = NO
|
||||||
INCDIRS += targets/mega2560 targets/stock $(FATFSDIR) $(FATFSDIR)/option
|
INCDIRS += targets/mega2560 targets/stock $(FATFSDIR) $(FATFSDIR)/option
|
||||||
BOARDSRC = main_avr.cpp targets/mega2560/board_mega2560.cpp
|
BOARDSRC = main_avr.cpp targets/mega2560/board_mega2560.cpp
|
||||||
EEPROMSRC = eeprom_common.cpp eeprom_rlc.cpp
|
EEPROMSRC = eeprom_common.cpp eeprom_rlc.cpp
|
||||||
@@ -702,6 +703,10 @@ ifeq ($(PCB), MEGA2560)
|
|||||||
|
|
||||||
EXTRABOARDSRC = targets/common_avr/adc_driver.cpp targets/stock/lcd_driver.cpp targets/common_avr/telemetry_driver.cpp
|
EXTRABOARDSRC = targets/common_avr/adc_driver.cpp targets/stock/lcd_driver.cpp targets/common_avr/telemetry_driver.cpp
|
||||||
|
|
||||||
|
ifeq ($(PWRMANAGE), YES)
|
||||||
|
CPPDEFS += -DPWRMANAGE
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(SDCARD), YES)
|
ifeq ($(SDCARD), YES)
|
||||||
EXTRABOARDSRC += $(FATFSDIR)/ff.c $(FATFSDIR)/fattime.c $(FATFSDIR)/option/ccsbcs.c targets/gruvin9x/diskio.cpp
|
EXTRABOARDSRC += $(FATFSDIR)/ff.c $(FATFSDIR)/fattime.c $(FATFSDIR)/option/ccsbcs.c targets/gruvin9x/diskio.cpp
|
||||||
CPPDEFS += -DSDCARD -DRTCLOCK
|
CPPDEFS += -DSDCARD -DRTCLOCK
|
||||||
@@ -709,6 +714,14 @@ ifeq ($(PCB), MEGA2560)
|
|||||||
CPPSRC += rtc.cpp sdcard.cpp logs.cpp targets/gruvin9x/rtc_driver.cpp
|
CPPSRC += rtc.cpp sdcard.cpp logs.cpp targets/gruvin9x/rtc_driver.cpp
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(AUDIO), YES)
|
||||||
|
CPPDEFS += -DAUDIO
|
||||||
|
CPPSRC += audio_avr.cpp
|
||||||
|
BUZZER = NO
|
||||||
|
else
|
||||||
|
BUZZER = YES
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(BUZZER), YES)
|
ifeq ($(BUZZER), YES)
|
||||||
CPPDEFS += -DBUZZER
|
CPPDEFS += -DBUZZER
|
||||||
CPPSRC += buzzer.cpp
|
CPPSRC += buzzer.cpp
|
||||||
@@ -719,6 +732,11 @@ ifeq ($(PCB), MEGA2560)
|
|||||||
CPPSRC += targets/gruvin9x/somo14d.cpp
|
CPPSRC += targets/gruvin9x/somo14d.cpp
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(HAPTIC), YES)
|
||||||
|
CPPDEFS += -DHAPTIC
|
||||||
|
CPPSRC += haptic.cpp
|
||||||
|
endif
|
||||||
|
|
||||||
# Enable extra rotary encoders
|
# Enable extra rotary encoders
|
||||||
ROTARY_ENCODERS = 2
|
ROTARY_ENCODERS = 2
|
||||||
CPPDEFS += -DROTARY_ENCODERS=${ROTARY_ENCODERS}
|
CPPDEFS += -DROTARY_ENCODERS=${ROTARY_ENCODERS}
|
||||||
|
|||||||
@@ -65,10 +65,10 @@ inline void boardInit()
|
|||||||
// Set up Phase correct Waveform Gen. mode, at clk/64 = 250,000 counts/second
|
// Set up Phase correct Waveform Gen. mode, at clk/64 = 250,000 counts/second
|
||||||
// (Higher speed allows for finer control of frequencies in the audio range.)
|
// (Higher speed allows for finer control of frequencies in the audio range.)
|
||||||
// Used for audio tone generation
|
// Used for audio tone generation
|
||||||
TCCR0B = (1<<WGM02) | (0b011 << CS00);
|
TCCR4B = (1<<WGM42) | (0b011 << CS00);
|
||||||
TCCR0A = (0b01<<WGM00);
|
TCCR4A = (0b01<<WGM40);
|
||||||
|
|
||||||
#if defined (VOICE)
|
#if defined (VOICE) // OLD FROM GRUVIN9X, TO REWRITE
|
||||||
// SOMO set-up
|
// SOMO set-up
|
||||||
OCR4A = 0x1F4; //2ms
|
OCR4A = 0x1F4; //2ms
|
||||||
TCCR4B = (1 << WGM42) | (0b011 << CS40); // CTC OCR1A, 16MHz / 64 (4us ticks)
|
TCCR4B = (1 << WGM42) | (0b011 << CS40); // CTC OCR1A, 16MHz / 64 (4us ticks)
|
||||||
|
|||||||
@@ -170,21 +170,27 @@ void sdPoll10ms(void);
|
|||||||
// Power driver
|
// Power driver
|
||||||
uint8_t pwrCheck();
|
uint8_t pwrCheck();
|
||||||
void pwrOff();
|
void pwrOff();
|
||||||
|
#if defined(PWRMANAGE)
|
||||||
#define UNEXPECTED_SHUTDOWN() ((mcusr & (1 << WDRF)) || g_eeGeneral.unexpectedShutdown)
|
#define UNEXPECTED_SHUTDOWN() ((mcusr & (1 << WDRF)) || g_eeGeneral.unexpectedShutdown)
|
||||||
|
#else
|
||||||
|
#define UNEXPECTED_SHUTDOWN() (mcusr & (1 << WDRF))
|
||||||
|
#endif
|
||||||
|
|
||||||
// USB fake driver
|
// USB fake driver
|
||||||
#define usbPlugged() false
|
#define usbPlugged() false
|
||||||
|
|
||||||
// Haptic driver
|
// Haptic driver
|
||||||
#define hapticOff() // TODO hapticOn() cleaner ...
|
#define hapticOff() // TODO hapticOn() cleaner ...
|
||||||
|
#define HAPTIC_ON() PORTH &= ~(1 << OUT_H_HAPTIC)
|
||||||
|
#define HAPTIC_OFF() PORTH |= (1 << OUT_H_HAPTIC)
|
||||||
|
|
||||||
// Buzzer driver
|
// Buzzer driver
|
||||||
#define buzzerOn() PORTB |= (1 << OUT_B_BUZZER)
|
#define buzzerOn() PORTB |= (1 << OUT_B_BUZZER)
|
||||||
#define buzzerOff() PORTB &= ~(1 << OUT_B_BUZZER)
|
#define buzzerOff() PORTB &= ~(1 << OUT_B_BUZZER)
|
||||||
|
|
||||||
// Speaker driver
|
// Speaker driver
|
||||||
#define speakerOn() TCCR0A |= (1 << COM0A0)
|
#define speakerOn() TCCR4A |= (1 << COM4A0)
|
||||||
#define speakerOff() TCCR0A &= ~(1 << COM0A0)
|
#define speakerOff() TCCR4A &= ~(1 << COM4A0)
|
||||||
|
|
||||||
// EEPROM driver
|
// EEPROM driver
|
||||||
#if !defined(SIMU)
|
#if !defined(SIMU)
|
||||||
|
|||||||
Reference in New Issue
Block a user