Initial public release.
This commit is contained in:
parent
7b169e8116
commit
dac4af8d25
255 changed files with 68595 additions and 2 deletions
64
2020TPCApp1.cydsn/Menu/HardwareSettings/HandedMenuItem.c
Normal file
64
2020TPCApp1.cydsn/Menu/HardwareSettings/HandedMenuItem.c
Normal file
|
@ -0,0 +1,64 @@
|
|||
/* Include Files */
|
||||
#include "KTag.h"
|
||||
|
||||
static void OnFocus(bool IncludeDetails);
|
||||
static MenuItem_T const * OnSelect();
|
||||
static void OnIncrement();
|
||||
static void OnDecrement();
|
||||
static void ToggleHanded();
|
||||
|
||||
const MenuItem_T HandedMenuItem =
|
||||
{
|
||||
.OnFocus = OnFocus,
|
||||
.OnSelect = OnSelect,
|
||||
.OnIncrement = OnIncrement,
|
||||
.OnDecrement = OnDecrement
|
||||
|
||||
};
|
||||
|
||||
static void OnFocus(bool IncludeDetails)
|
||||
{
|
||||
if (NVM_IS_RIGHT_HANDED == true)
|
||||
{
|
||||
AudioAction_T audio_action = {.ID = AUDIO_PLAY_RIGHT_HANDED, .Play_To_Completion = true, .Data = (void *)0x00};
|
||||
xQueueSend(xQueueAudio, &audio_action, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
AudioAction_T audio_action = {.ID = AUDIO_PLAY_LEFT_HANDED, .Play_To_Completion = true, .Data = (void *)0x00};
|
||||
xQueueSend(xQueueAudio, &audio_action, 0);
|
||||
}
|
||||
}
|
||||
|
||||
static MenuItem_T const * OnSelect()
|
||||
{
|
||||
AudioAction_T audio_action = {.ID = AUDIO_PLAY_SELECTION_INDICATOR, .Data = (void *)0x00};
|
||||
xQueueSend(xQueueAudio, &audio_action, 0);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void OnIncrement()
|
||||
{
|
||||
ToggleHanded();
|
||||
}
|
||||
|
||||
static void OnDecrement()
|
||||
{
|
||||
ToggleHanded();
|
||||
}
|
||||
|
||||
static void ToggleHanded()
|
||||
{
|
||||
if (NVM_IS_RIGHT_HANDED == true)
|
||||
{
|
||||
NVM_IS_RIGHT_HANDED = false;
|
||||
AudioAction_T audio_action = {.ID = AUDIO_PLAY_LEFT_HANDED, .Play_To_Completion = true, .Data = (void *)0x00};
|
||||
xQueueSend(xQueueAudio, &audio_action, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
NVM_IS_RIGHT_HANDED = true;
|
||||
AudioAction_T audio_action = {.ID = AUDIO_PLAY_RIGHT_HANDED, .Play_To_Completion = true, .Data = (void *)0x00};
|
||||
xQueueSend(xQueueAudio, &audio_action, 0);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue