waveplayer with play pause
Dependents: WavePlayer_HelloWorld_RTOS5
Diff: wave_player.cpp
- Revision:
- 3:a94dd18e8d8e
- Parent:
- 2:cb60c55b6628
diff -r cb60c55b6628 -r a94dd18e8d8e wave_player.cpp --- a/wave_player.cpp Sun Dec 12 20:08:11 2021 +0000 +++ b/wave_player.cpp Wed Dec 15 17:16:51 2021 +0000 @@ -16,6 +16,7 @@ #include <wave_player.h> extern bool playing; + short unsigned dac_data; //----------------------------------------------------------------------------- @@ -50,7 +51,7 @@ { unsigned chunk_id,chunk_size,channel; unsigned data,samp_int,i; - short unsigned dac_data; + //short unsigned dac_data; long long slice_value; char *slice_buf; short *data_sptr; @@ -131,7 +132,7 @@ // while 16 and 32 bit wave files use signed data // for (slice=0;slice<num_slices;slice+=1) { - if (playing == true){ + if (playing == false){ break; } @@ -214,4 +215,8 @@ DAC_rptr=(DAC_rptr+1) & 0xff; } } - +void wave_player::update_level() +{ + dac_data_pub=dac_data; +} +