PokittoLib is the library needed for programming the Pokitto DIY game console (www.pokitto.com)
Dependents: YATTT sd_map_test cPong SnowDemo ... more
PokittoLib
Library for programming Pokitto hardware
How to Use
- Import this library to online compiler (see button "import" on the right hand side
- DO NOT import mbed-src anymore, a better version is now included inside PokittoLib
- Change My_settings.h according to your project
- Start coding!
Diff: POKITTO_HW/HWSound.cpp
- Revision:
- 33:7d20a1e51908
- Parent:
- 32:6d5a63b6d5b6
- Child:
- 34:427237571c6a
--- a/POKITTO_HW/HWSound.cpp Tue Jan 30 10:51:42 2018 +0000 +++ b/POKITTO_HW/HWSound.cpp Sat Mar 10 19:03:26 2018 +0000 @@ -52,8 +52,10 @@ using namespace Pokitto; #ifndef POK_SIM +#if POK_ENABLE_SOUND > 0 pwmout_t* obj = &audiopwm; #endif +#endif /** Sound Variables **/ #if (POK_STREAMING_MUSIC > 0) @@ -232,6 +234,7 @@ /** SOUND INIT **/ void Pokitto::soundInit() { uint32_t timerFreq; + #if POK_ENABLE_SOUND pwmout_init(&audiopwm,POK_AUD_PIN); pwmout_period_us(&audiopwm,POK_AUD_PWM_US); //was 31us pwmout_write(&audiopwm,0.1f); @@ -284,7 +287,7 @@ #if POK_BOARDREV == 2 initHWvolumecontrol(); #endif - + #endif //POK_ENABLE_SOUND } @@ -320,13 +323,7 @@ } void pokSoundIRQ() { - //#define TICKY 0xFFFF //160 - //#define INCY 409 - uint8_t output=0; - //if (test==TICKY) test=0; - //if (test<(TICKY/2)) { tpin=1; pwmout_write(&audiopwm,(float)0/(float)255);}//dac_write(0);} - //else {tpin=0; pwmout_write(&audiopwm,(float)255/(float)255);}//dac_write(64);} - //test+=INCY; + #if POK_ENABLE_SOUND > 0 //return; #ifndef POK_SIM pwmout_t* obj = &audiopwm; @@ -413,6 +410,7 @@ soundbuf[soundbufindex++]=soundbyte; #endif //POK_ENABLE_SOUND #endif // HARDWARE + #endif //POK_ENABLE_SOUND }