Add ifdefs for CSR in note header and source

This commit is contained in:
Aadi Desai 2023-05-22 13:26:37 +01:00
parent 6c54b80d80
commit 4c831539a8
No known key found for this signature in database
2 changed files with 4 additions and 0 deletions

View file

@ -4,8 +4,10 @@
// Function Definition
#ifdef CSR_AUDIO_BASE
void note(uint32_t frequency, unsigned int duration_ms);
void wave(uint32_t wave);
#endif
// Notes

View file

@ -1,6 +1,7 @@
#include <generated/csr.h>
#include <stdint.h>
#ifdef CSR_AUDIO_BASE
void note(uint32_t frequency, unsigned int duration_ms) {
audio_targ0_write(frequency);
busy_wait(duration_ms);
@ -10,3 +11,4 @@ void note(uint32_t frequency, unsigned int duration_ms) {
void wave(uint32_t wave) {
audio_wave0_write(wave);
}
#endif