This commit is contained in:
jake-b
2016-07-05 07:42:22 +00:00
committed by GitHub
3 changed files with 343 additions and 108 deletions

View File

@@ -8,6 +8,12 @@
#define RESET_PIN A3
#define SWITCH_PIN 2
#ifdef __SAMD21G18A__
// NOTE: this won't really work for the Ardiuno Zero, as it will be playing its tones
// out of AO, rather than D3 or D11. Hook up your oscilloscope to A0 to see the waveform.
#warning Hamshield may not be compatible with the Arduino Zero.
#endif
HamShield radio;
DDS dds;
@@ -41,6 +47,31 @@ void loop() {
delay(1000);
}
#ifdef __SAMD21G18A__
#ifdef __cplusplus
extern "C" {
#endif
// ISR for the Arduino Zero Timer/Counter 5
// DDS configures this to run at 44100 (default)
void DDS_Handler (void) {
// Do the thing
dds.clockTick();
// Clear the interrupt
TC5->COUNT16.INTFLAG.bit.MC0 = 1;
}
void TC5_Handler (void) __attribute__ ((weak, alias("DDS_Handler")));
#ifdef __cplusplus
}
#endif
#else
// Standard AVR ISRs
#ifdef DDS_USE_ONLY_TIMER2
ISR(TIMER2_OVF_vect) {
dds.clockTick();
@@ -54,4 +85,7 @@ ISR(ADC_vect) {
}
dds.clockTick();
}
#endif
#endif /* DDS_USE_ONLY_TIMER2 */
#endif /* __SAMD21G18A__ */