mirror of
https://github.com/supleed2/EIE4-FYP.git
synced 2024-12-22 22:25:50 +00:00
Add ifdefs for CSR in note header and source
This commit is contained in:
parent
6c54b80d80
commit
4c831539a8
|
@ -4,8 +4,10 @@
|
||||||
|
|
||||||
// Function Definition
|
// Function Definition
|
||||||
|
|
||||||
|
#ifdef CSR_AUDIO_BASE
|
||||||
void note(uint32_t frequency, unsigned int duration_ms);
|
void note(uint32_t frequency, unsigned int duration_ms);
|
||||||
void wave(uint32_t wave);
|
void wave(uint32_t wave);
|
||||||
|
#endif
|
||||||
|
|
||||||
// Notes
|
// Notes
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#include <generated/csr.h>
|
#include <generated/csr.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#ifdef CSR_AUDIO_BASE
|
||||||
void note(uint32_t frequency, unsigned int duration_ms) {
|
void note(uint32_t frequency, unsigned int duration_ms) {
|
||||||
audio_targ0_write(frequency);
|
audio_targ0_write(frequency);
|
||||||
busy_wait(duration_ms);
|
busy_wait(duration_ms);
|
||||||
|
@ -10,3 +11,4 @@ void note(uint32_t frequency, unsigned int duration_ms) {
|
||||||
void wave(uint32_t wave) {
|
void wave(uint32_t wave) {
|
||||||
audio_wave0_write(wave);
|
audio_wave0_write(wave);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue