Audio-Beispiel
Dependencies: mbed X_NUCLEO_CCA01M1
Revision 5:ac729170df5f, committed 2017-04-21
- Comitter:
- davide.aliprandi@st.com
- Date:
- Fri Apr 21 10:09:14 2017 +0200
- Parent:
- 4:6bb9e11d322b
- Child:
- 6:587f562ab2be
- Commit message:
- Aligned to ARM mbed coding style.
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Mon Apr 10 13:16:41 2017 +0000
+++ b/main.cpp Fri Apr 21 10:09:14 2017 +0200
@@ -50,7 +50,7 @@
#include "DevI2C.h"
/* Component specific header files. */
-#include "sta350bw_class.h"
+#include "STA350BW.h"
/* My song header file. */
#include "my_song.h"
@@ -102,7 +102,7 @@
* @param None.
* @retval None.
*/
-void PlayStopHandler(void)
+void play_stop_handler(void)
{
while (true)
{
@@ -112,9 +112,9 @@
play_stop_thread->signal_wait(PLAY_STOP_EVENT);
if (stop)
- sound_terminal->Stop();
+ sound_terminal->stop();
else
- sound_terminal->Play((int16_t *) my_song, (uint16_t) sizeof(my_song), true);
+ sound_terminal->play((int16_t *) my_song, (uint16_t) sizeof(my_song), true);
printf("--> %s\r\n", stop ? "Stop." : "Playing...");
stop = !stop;
@@ -139,7 +139,7 @@
#else
sound_terminal = new STA350BW(PA_10, STA350BW_ADDRESS_2, *dev_i2c, PC_12, PC_10, PA_4, NC, PC_7);
#endif
- if (sound_terminal->Init(&init) != COMPONENT_OK)
+ if (sound_terminal->init(&init) != COMPONENT_OK)
{
error("Initialization of the Sound Terminal Expansion Board failed.\r\n");
exit(EXIT_FAILURE);
@@ -151,14 +151,14 @@
/* Scheduling the play/stop function. */
play_stop_thread = new Thread();
- osStatus status = play_stop_thread->start(PlayStopHandler);
+ osStatus status = play_stop_thread->start(play_stop_handler);
if (status != osOK)
printf("Could not start the play/stop handler thread.\r\n");
event.fall(&pressed);
/* Setting Sound Terminal Component's parameters. */
- sound_terminal->SetFrequency(MY_SONG_AUDIO_FREQUENCY);
- sound_terminal->SetVolume(STA350BW_CHANNEL_MASTER, 60);
+ sound_terminal->set_frequency(MY_SONG_AUDIO_FREQUENCY);
+ sound_terminal->set_volume(STA350BW_CHANNEL_MASTER, 60);
/* Printing to the console. */
printf("Sound Terminal Application Example\r\n\n");
@@ -168,7 +168,7 @@
/* Printing to the console. */
printf("--> Playing...\r\n");
- sound_terminal->Play((int16_t *) my_song, (uint16_t) sizeof(my_song), true);
+ sound_terminal->play((int16_t *) my_song, (uint16_t) sizeof(my_song), true);
}
#else // DEVICE_I2S