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:
JivaroFAD
2015-06-01 00:11:35 +02:00
parent 05f7286eb8
commit 61c7abf214
6 changed files with 544 additions and 480 deletions
@@ -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)
+9 -3
View File
@@ -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)