Rolling back changes from a7a167c19b that broke the build. Please test on actual hardware before pull-requesting "improvements"...

This commit is contained in:
Mark Qvist 2015-11-17 08:09:39 +01:00
parent cd07dc7e67
commit 1f94513b58
3 changed files with 15 additions and 38 deletions

View file

@ -38,9 +38,9 @@ void AFSK_hw_init(void) {
ADMUX = 0;
}
ADC_DDR &= ~_BV(ADC_NO);
ADC_PORT &= ~_BV(ADC_NO);
DIDR0 |= _BV(ADC_NO);
ADC_DDR &= ~_BV(0);
ADC_PORT &= ~_BV(0);
DIDR0 |= _BV(0);
ADCSRB = _BV(ADTS2) |
_BV(ADTS1) |
_BV(ADTS0);
@ -51,7 +51,6 @@ void AFSK_hw_init(void) {
_BV(ADPS2);
AFSK_DAC_INIT();
PTT_INIT();
LED_TX_INIT();
LED_RX_INIT();
}
@ -85,7 +84,6 @@ static void AFSK_txStart(Afsk *afsk) {
afsk->phaseAcc = 0;
afsk->bitstuffCount = 0;
afsk->sending = true;
PTT_TX_ON();
LED_TX_ON();
afsk->preambleLength = DIV_ROUND(custom_preamble * BITRATE, 8000);
AFSK_DAC_IRQ_START();
@ -123,7 +121,6 @@ uint8_t AFSK_dac_isr(Afsk *afsk) {
if (fifo_isempty(&afsk->txFifo) && afsk->tailLength == 0) {
AFSK_DAC_IRQ_STOP();
afsk->sending = false;
PTT_TX_OFF();
LED_TX_OFF();
return 0;
} else {
@ -144,7 +141,6 @@ uint8_t AFSK_dac_isr(Afsk *afsk) {
if (fifo_isempty(&afsk->txFifo)) {
AFSK_DAC_IRQ_STOP();
afsk->sending = false;
PTT_TX_OFF();
LED_TX_OFF();
return 0;
} else {
@ -503,12 +499,9 @@ ISR(ADC_vect) {
TIFR1 = _BV(ICF1);
AFSK_adc_isr(AFSK_modem, ((int16_t)((ADC) >> 2) - 128));
if (hw_afsk_dac_isr) {
// Set DAC pin(s) according to position in SIN wave.
DAC_PORT |= (AFSK_dac_isr(AFSK_modem) & DAC_PINS);
DAC_PORT = (AFSK_dac_isr(AFSK_modem) & 0xF0) | _BV(3);
} else {
// Set DAC pin(s) to the zero point in the SIN wave.
// This is represented by setting only the high-bit.
DAC_PORT = (DAC_PORT & (~DAC_PINS)) | DAC_HIGH;
DAC_PORT = 128;
}
++_clock;
}
}