Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Techno Slide Whistle Mode #131

Merged
merged 8 commits into from
Nov 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions components/hdw-bzr/hdw-bzr.c
Original file line number Diff line number Diff line change
Expand Up @@ -604,3 +604,18 @@ void bzrRestore(void* data)

free(data);
}

/**
* @brief Get the actual volume level from the setting
*
* @param setting The volume level setting
* @return The actual volume
*/
uint16_t volLevelFromSetting(uint16_t setting)
{
if (setting < (sizeof(volLevels) / sizeof(volLevels[0])))
{
return volLevels[setting];
}
return 0;
}
1 change: 1 addition & 0 deletions components/hdw-bzr/include/hdw-bzr.h
Original file line number Diff line number Diff line change
Expand Up @@ -272,5 +272,6 @@ bool bzrPause(void);
void bzrResume(void);
void* bzrSave(void);
void bzrRestore(void* data);
uint16_t volLevelFromSetting(uint16_t setting);

#endif
15 changes: 15 additions & 0 deletions emulator/src/components/hdw-bzr/hdw-bzr.c
Original file line number Diff line number Diff line change
Expand Up @@ -533,3 +533,18 @@ void bzrRestore(void* data)

free(data);
}

/**
* @brief Get the actual volume level from the setting
*
* @param setting The volume level setting
* @return The actual volume
*/
uint16_t volLevelFromSetting(uint16_t setting)
{
if (setting < (sizeof(volLevels) / sizeof(volLevels[0])))
{
return volLevels[setting];
}
return 0;
}
6 changes: 6 additions & 0 deletions emulator/src/components/hdw-imu/hdw-imu.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@ esp_err_t accelGetOrientVec(int16_t* x, int16_t* y, int16_t* z)
return accelGetAccelVecRaw(x, y, z);
}

esp_err_t accelGetQuaternion(float* q)
{
// TODO: implement proper emulation of this function.
return ESP_OK;
}

/**
* @brief Sets the raw accelerometer reading to be returned by the emulator
*
Expand Down
2 changes: 2 additions & 0 deletions main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ idf_component_register(SRCS "swadge2024.c"
"modes/ray/enemies/ray_enemy_normal.h"
"modes/ray/enemies/ray_enemy_strong.c"
"modes/ray/enemies/ray_enemy_strong.h"
"modes/slideWhistle/slideWhistle.c"
"modes/soko/soko_game.c"
"modes/soko/soko_gamerules.c"
"modes/soko/soko_input.c"
Expand Down Expand Up @@ -138,6 +139,7 @@ idf_component_register(SRCS "swadge2024.c"
"./modes/quickSettings"
"./modes/ray"
"./modes/ray/enemies"
"./modes/slideWhistle"
"./modes/soko"
"./modes/touchTest"
"./modes/tunernome")
Expand Down
6 changes: 6 additions & 0 deletions main/modes/mainMenu/mainMenu.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "mode_ray.h"
#include "paint_share.h"
#include "pushy.h"
#include "slideWhistle.h"
#include "soko.h"
#include "touchTest.h"
#include "tunernome.h"
Expand Down Expand Up @@ -142,6 +143,7 @@ static void mainMenuEnterMode(void)
addSingleItemToMenu(mainMenu->menu, colorchordMode.modeName);
addSingleItemToMenu(mainMenu->menu, jukeboxMode.modeName);
addSingleItemToMenu(mainMenu->menu, tunernomeMode.modeName);
addSingleItemToMenu(mainMenu->menu, slideWhistleMode.modeName);
mainMenu->menu = endSubMenu(mainMenu->menu);

mainMenu->menu = startSubMenu(mainMenu->menu, "Utilities");
Expand Down Expand Up @@ -332,6 +334,10 @@ static void mainMenuCb(const char* label, bool selected, uint32_t settingVal)
{
switchToSwadgeMode(&sokoMode);
}
else if (label == slideWhistleMode.modeName)
{
switchToSwadgeMode(&slideWhistleMode);
}
else if (label == touchTestMode.modeName)
{
switchToSwadgeMode(&touchTestMode);
Expand Down
Loading