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 */
|
||||
openTx = new OpenTxFirmware("opentx-mega2560", QObject::tr("OpenTX for MEGA2560 board"), BOARD_MEGA2560);
|
||||
addOpenTxLcdOptions(openTx);
|
||||
openTx->addOption("PWR", QObject::tr("Power management by soft-off circuitry"));
|
||||
openTx->addOptions(ext_options);
|
||||
openTx->addOption("PXX", QObject::tr("Support of FrSky PXX protocol"));
|
||||
openTx->addOptions(dsm2_options);
|
||||
@@ -1264,7 +1265,9 @@ void registerOpenTxFirmwares()
|
||||
openTx->addOption("nofp", QObject::tr("No flight modes"));
|
||||
openTx->addOption("nocurves", QObject::tr("Disable curves menus"));
|
||||
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("gvars", QObject::tr("Global variables"), GVARS_VARIANT);
|
||||
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
|
||||
BUZZER = YES
|
||||
THR_TRACE = YES
|
||||
PWRMANAGE = NO
|
||||
INCDIRS += targets/mega2560 targets/stock $(FATFSDIR) $(FATFSDIR)/option
|
||||
BOARDSRC = main_avr.cpp targets/mega2560/board_mega2560.cpp
|
||||
EEPROMSRC = eeprom_common.cpp eeprom_rlc.cpp
|
||||
@@ -701,6 +702,10 @@ ifeq ($(PCB), MEGA2560)
|
||||
GUIGENERALSRC += gui/$(GUIDIRECTORY)/menu_general_diagkeys.cpp gui/$(GUIDIRECTORY)/menu_general_diaganas.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)
|
||||
EXTRABOARDSRC += $(FATFSDIR)/ff.c $(FATFSDIR)/fattime.c $(FATFSDIR)/option/ccsbcs.c targets/gruvin9x/diskio.cpp
|
||||
@@ -709,6 +714,14 @@ ifeq ($(PCB), MEGA2560)
|
||||
CPPSRC += rtc.cpp sdcard.cpp logs.cpp targets/gruvin9x/rtc_driver.cpp
|
||||
endif
|
||||
|
||||
ifeq ($(AUDIO), YES)
|
||||
CPPDEFS += -DAUDIO
|
||||
CPPSRC += audio_avr.cpp
|
||||
BUZZER = NO
|
||||
else
|
||||
BUZZER = YES
|
||||
endif
|
||||
|
||||
ifeq ($(BUZZER), YES)
|
||||
CPPDEFS += -DBUZZER
|
||||
CPPSRC += buzzer.cpp
|
||||
@@ -718,6 +731,11 @@ ifeq ($(PCB), MEGA2560)
|
||||
CPPDEFS += -DVOICE
|
||||
CPPSRC += targets/gruvin9x/somo14d.cpp
|
||||
endif
|
||||
|
||||
ifeq ($(HAPTIC), YES)
|
||||
CPPDEFS += -DHAPTIC
|
||||
CPPSRC += haptic.cpp
|
||||
endif
|
||||
|
||||
# Enable extra rotary encoders
|
||||
ROTARY_ENCODERS = 2
|
||||
|
||||
@@ -65,10 +65,10 @@ inline void boardInit()
|
||||
// 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.)
|
||||
// Used for audio tone generation
|
||||
TCCR0B = (1<<WGM02) | (0b011 << CS00);
|
||||
TCCR0A = (0b01<<WGM00);
|
||||
TCCR4B = (1<<WGM42) | (0b011 << CS00);
|
||||
TCCR4A = (0b01<<WGM40);
|
||||
|
||||
#if defined (VOICE)
|
||||
#if defined (VOICE) // OLD FROM GRUVIN9X, TO REWRITE
|
||||
// SOMO set-up
|
||||
OCR4A = 0x1F4; //2ms
|
||||
TCCR4B = (1 << WGM42) | (0b011 << CS40); // CTC OCR1A, 16MHz / 64 (4us ticks)
|
||||
|
||||
@@ -170,21 +170,27 @@ void sdPoll10ms(void);
|
||||
// Power driver
|
||||
uint8_t pwrCheck();
|
||||
void pwrOff();
|
||||
#if defined(PWRMANAGE)
|
||||
#define UNEXPECTED_SHUTDOWN() ((mcusr & (1 << WDRF)) || g_eeGeneral.unexpectedShutdown)
|
||||
#else
|
||||
#define UNEXPECTED_SHUTDOWN() (mcusr & (1 << WDRF))
|
||||
#endif
|
||||
|
||||
// USB fake driver
|
||||
#define usbPlugged() false
|
||||
|
||||
// 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
|
||||
#define buzzerOn() PORTB |= (1 << OUT_B_BUZZER)
|
||||
#define buzzerOff() PORTB &= ~(1 << OUT_B_BUZZER)
|
||||
|
||||
// Speaker driver
|
||||
#define speakerOn() TCCR0A |= (1 << COM0A0)
|
||||
#define speakerOff() TCCR0A &= ~(1 << COM0A0)
|
||||
#define speakerOn() TCCR4A |= (1 << COM4A0)
|
||||
#define speakerOff() TCCR4A &= ~(1 << COM4A0)
|
||||
|
||||
// EEPROM driver
|
||||
#if !defined(SIMU)
|
||||
|
||||
Reference in New Issue
Block a user