Skip to content

Commit

Permalink
update pico_flash_param submodule. take revision from P_CFG_REVISION
Browse files Browse the repository at this point in the history
  • Loading branch information
elehobica committed Jun 1, 2024
1 parent 402bfef commit 68e1da3
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 110 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Changed
* Replace transistor with MOS-FET in battery operation circuit (Q2) thanks to conditional pullup
* Self-check if active battery check circuit is populated, not by USE_ACTIVE_BATTERY_CHECK macro definition
* Use submodule for pico_flash_param library
### Fixed
* Add workaround for mount fail case of Samsung PRO Plus card

Expand Down
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ set(bin_name ${PROJECT_NAME})
add_executable(${bin_name}
src/main.cpp
src/ConfigMenu.cpp
src/ConfigParam.cpp
src/ImageFitter.cpp
src/lcd_background.cpp
src/LcdCanvas.cpp
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ For complete portable player with Li-Po battery operation, refer to the followin
* Confirmed with cmake-3.27.2-windows-x86_64 and gcc-arm-none-eabi-10.3-2021.10-win32
* Lanuch "Developer Command Prompt for VS 2022"
```
> cd pico_spdif_recorder
> cd RPi_Pico_WAV_Player
> mkdir build && cd build
> cmake -G "NMake Makefiles" ..
> nmake
Expand All @@ -140,7 +140,7 @@ For complete portable player with Li-Po battery operation, refer to the followin
* Build is confirmed with [rp2040-dev-docker:sdk-1.5.1-1.0.1]( https://hub.docker.com/r/elehobica/rp2040-dev-docker)
* Confirmed with cmake-3.22.1 and arm-none-eabi-gcc (15:10.3-2021.07-4) 10.3.1
```
$ cd pico_spdif_recorder
> cd RPi_Pico_WAV_Player
$ mkdir build && cd build
$ cmake ..
$ make -j4
Expand Down
45 changes: 0 additions & 45 deletions src/ConfigParam.cpp

This file was deleted.

79 changes: 38 additions & 41 deletions src/ConfigParam.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
#include "FlashParam.h"

typedef enum {
CFG_BOOT_COUNT = 0,
CFG_FORMAT_REV,
CFG_REVISION = FlashParamNs::CFG_ID_BASE,
CFG_SEED,
CFG_VOLUME,
CFG_STACK_COUNT,
Expand Down Expand Up @@ -52,44 +51,42 @@ typedef enum {
// Interface of ConfigParam class
//=================================
struct ConfigParam : FlashParamNs::FlashParam {
static ConfigParam& instance(); // Singleton
uint32_t getBootCountFromFlash();
void incBootCount();
void initialize();

// Parameter<T> inst id name default
FlashParamNs::Parameter<uint32_t> P_CFG_BOOT_COUNT {CFG_BOOT_COUNT, "CFG_BOOT_COUNT", 10};
FlashParamNs::Parameter<uint32_t> P_CFG_FORMAT_REV {CFG_FORMAT_REV, "CFG_FORMAT_REV", 20240522}; // update value when updated to reset user flash
FlashParamNs::Parameter<uint32_t> P_CFG_SEED {CFG_SEED, "CFG_SEED", 0};
FlashParamNs::Parameter<uint8_t> P_CFG_VOLUME {CFG_VOLUME, "CFG_VOLUME", 65};
FlashParamNs::Parameter<uint8_t> P_CFG_STACK_COUNT {CFG_STACK_COUNT, "CFG_STACK_COUNT", 0};
FlashParamNs::Parameter<uint16_t> P_CFG_STACK_HEAD0 {CFG_STACK_HEAD0, "CFG_STACK_HEAD0", 0};
FlashParamNs::Parameter<uint16_t> P_CFG_STACK_COLUMN0 {CFG_STACK_COLUMN0, "CFG_STACK_COLUMN0", 0};
FlashParamNs::Parameter<uint16_t> P_CFG_STACK_HEAD1 {CFG_STACK_HEAD1, "CFG_STACK_HEAD1", 0};
FlashParamNs::Parameter<uint16_t> P_CFG_STACK_COLUMN1 {CFG_STACK_COLUMN1, "CFG_STACK_COLUMN1", 0};
FlashParamNs::Parameter<uint16_t> P_CFG_STACK_HEAD2 {CFG_STACK_HEAD2, "CFG_STACK_HEAD2", 0};
FlashParamNs::Parameter<uint16_t> P_CFG_STACK_COLUMN2 {CFG_STACK_COLUMN2, "CFG_STACK_COLUMN2", 0};
FlashParamNs::Parameter<uint16_t> P_CFG_STACK_HEAD3 {CFG_STACK_HEAD3, "CFG_STACK_HEAD3", 0};
FlashParamNs::Parameter<uint16_t> P_CFG_STACK_COLUMN3 {CFG_STACK_COLUMN3, "CFG_STACK_COLUMN3", 0};
FlashParamNs::Parameter<uint16_t> P_CFG_STACK_HEAD4 {CFG_STACK_HEAD4, "CFG_STACK_HEAD4", 0};
FlashParamNs::Parameter<uint16_t> P_CFG_STACK_COLUMN4 {CFG_STACK_COLUMN4, "CFG_STACK_COLUMN4", 0};
FlashParamNs::Parameter<uint32_t> P_CFG_UIMODE {CFG_UIMODE, "CFG_UIMODE", 0};
FlashParamNs::Parameter<uint16_t> P_CFG_IDX_HEAD {CFG_IDX_HEAD, "CFG_IDX_HEAD", 0};
FlashParamNs::Parameter<uint16_t> P_CFG_IDX_COLUMN {CFG_IDX_COLUMN, "CFG_IDX_COLUMN", 0};
FlashParamNs::Parameter<uint16_t> P_CFG_IDX_PLAY {CFG_IDX_PLAY, "CFG_IDX_PLAY", 0};
FlashParamNs::Parameter<uint64_t> P_CFG_PLAY_POS {CFG_PLAY_POS, "CFG_PLAY_POS", 0};
FlashParamNs::Parameter<uint32_t> P_CFG_SAMPLES_PLAYED {CFG_SAMPLES_PLAYED, "CFG_SAMPLES_PLAYED", 0};
static ConfigParam& instance() { // Singleton
static ConfigParam instance;
return instance;
}
// Parameter<T> inst id name default size
FlashParamNs::Parameter<std::string> P_CFG_REVISION {CFG_REVISION, "CFG_REVISION", "0.9.4", 8};
FlashParamNs::Parameter<uint32_t> P_CFG_SEED {CFG_SEED, "CFG_SEED", 0};
FlashParamNs::Parameter<uint8_t> P_CFG_VOLUME {CFG_VOLUME, "CFG_VOLUME", 65};
FlashParamNs::Parameter<uint8_t> P_CFG_STACK_COUNT {CFG_STACK_COUNT, "CFG_STACK_COUNT", 0};
FlashParamNs::Parameter<uint16_t> P_CFG_STACK_HEAD0 {CFG_STACK_HEAD0, "CFG_STACK_HEAD0", 0};
FlashParamNs::Parameter<uint16_t> P_CFG_STACK_COLUMN0 {CFG_STACK_COLUMN0, "CFG_STACK_COLUMN0", 0};
FlashParamNs::Parameter<uint16_t> P_CFG_STACK_HEAD1 {CFG_STACK_HEAD1, "CFG_STACK_HEAD1", 0};
FlashParamNs::Parameter<uint16_t> P_CFG_STACK_COLUMN1 {CFG_STACK_COLUMN1, "CFG_STACK_COLUMN1", 0};
FlashParamNs::Parameter<uint16_t> P_CFG_STACK_HEAD2 {CFG_STACK_HEAD2, "CFG_STACK_HEAD2", 0};
FlashParamNs::Parameter<uint16_t> P_CFG_STACK_COLUMN2 {CFG_STACK_COLUMN2, "CFG_STACK_COLUMN2", 0};
FlashParamNs::Parameter<uint16_t> P_CFG_STACK_HEAD3 {CFG_STACK_HEAD3, "CFG_STACK_HEAD3", 0};
FlashParamNs::Parameter<uint16_t> P_CFG_STACK_COLUMN3 {CFG_STACK_COLUMN3, "CFG_STACK_COLUMN3", 0};
FlashParamNs::Parameter<uint16_t> P_CFG_STACK_HEAD4 {CFG_STACK_HEAD4, "CFG_STACK_HEAD4", 0};
FlashParamNs::Parameter<uint16_t> P_CFG_STACK_COLUMN4 {CFG_STACK_COLUMN4, "CFG_STACK_COLUMN4", 0};
FlashParamNs::Parameter<uint32_t> P_CFG_UIMODE {CFG_UIMODE, "CFG_UIMODE", 0};
FlashParamNs::Parameter<uint16_t> P_CFG_IDX_HEAD {CFG_IDX_HEAD, "CFG_IDX_HEAD", 0};
FlashParamNs::Parameter<uint16_t> P_CFG_IDX_COLUMN {CFG_IDX_COLUMN, "CFG_IDX_COLUMN", 0};
FlashParamNs::Parameter<uint16_t> P_CFG_IDX_PLAY {CFG_IDX_PLAY, "CFG_IDX_PLAY", 0};
FlashParamNs::Parameter<uint64_t> P_CFG_PLAY_POS {CFG_PLAY_POS, "CFG_PLAY_POS", 0};
FlashParamNs::Parameter<uint32_t> P_CFG_SAMPLES_PLAYED {CFG_SAMPLES_PLAYED, "CFG_SAMPLES_PLAYED", 0};
// type of CFG_MENU_xxx must be uint32_t and default values indidicates index of selection (see ConfigMenu.h)
FlashParamNs::Parameter<uint32_t> P_CFG_MENU_IDX_GENERAL_TIME_TO_POWER_OFF {CFG_MENU_IDX_GENERAL_TIME_TO_POWER_OFF, "CFG_MENU_IDX_GENERAL_TIME_TO_POWER_OFF", 0};
FlashParamNs::Parameter<uint32_t> P_CFG_MENU_IDX_GENERAL_TIME_TO_LEAVE_CONFIG {CFG_MENU_IDX_GENERAL_TIME_TO_LEAVE_CONFIG, "CFG_MENU_IDX_GENERAL_TIME_TO_LEAVE_CONFIG", 1};
FlashParamNs::Parameter<uint32_t> P_CFG_MENU_IDX_GENERAL_PUSH_BUTTON_LAYOUT {CFG_MENU_IDX_GENERAL_PUSH_BUTTON_LAYOUT, "CFG_MENU_IDX_GENERAL_PUSH_BUTTON_LAYOUT", 0};
FlashParamNs::Parameter<uint32_t> P_CFG_MENU_IDX_GENERAL_HP_BUTTON_LAYOUT {CFG_MENU_IDX_GENERAL_HP_BUTTON_LAYOUT, "CFG_MENU_IDX_GENERAL_HP_BUTTON_LAYOUT", 1};
FlashParamNs::Parameter<uint32_t> P_CFG_MENU_IDX_DISPLAY_LCD_CONFIG {CFG_MENU_IDX_DISPLAY_LCD_CONFIG, "CFG_MENU_IDX_DISPLAY_LCD_CONFIG", 0};
FlashParamNs::Parameter<uint32_t> P_CFG_MENU_IDX_DISPLAY_ROTATION {CFG_MENU_IDX_DISPLAY_ROTATION, "CFG_MENU_IDX_DISPLAY_ROTATION", 0};
FlashParamNs::Parameter<uint32_t> P_CFG_MENU_IDX_DISPLAY_BACKLIGHT_LOW_LEVEL {CFG_MENU_IDX_DISPLAY_BACKLIGHT_LOW_LEVEL, "CFG_MENU_IDX_DISPLAY_BACKLIGHT_LOW_LEVEL", 7};
FlashParamNs::Parameter<uint32_t> P_CFG_MENU_IDX_DISPLAY_BACKLIGHT_HIGH_LEVEL {CFG_MENU_IDX_DISPLAY_BACKLIGHT_HIGH_LEVEL, "CFG_MENU_IDX_DISPLAY_BACKLIGHT_HIGH_LEVEL", 12};
FlashParamNs::Parameter<uint32_t> P_CFG_MENU_IDX_DISPLAY_TIME_TO_BACKLIGHT_LOW{CFG_MENU_IDX_DISPLAY_TIME_TO_BACKLIGHT_LOW, "CFG_MENU_IDX_DISPLAY_TIME_TO_BACKLIGHT_LOW", 1};
FlashParamNs::Parameter<uint32_t> P_CFG_MENU_IDX_PLAY_TIME_TO_NEXT_PLAY {CFG_MENU_IDX_PLAY_TIME_TO_NEXT_PLAY, "CFG_MENU_IDX_PLAY_TIME_TO_NEXT_PLAY", 2};
FlashParamNs::Parameter<uint32_t> P_CFG_MENU_IDX_PLAY_NEXT_PLAY_ALBUM {CFG_MENU_IDX_PLAY_NEXT_PLAY_ALBUM, "CFG_MENU_IDX_PLAY_NEXT_PLAY_ALBUM", 1};
FlashParamNs::Parameter<uint32_t> P_CFG_MENU_IDX_PLAY_RANDOM_DIR_DEPTH {CFG_MENU_IDX_PLAY_RANDOM_DIR_DEPTH, "CFG_MENU_IDX_PLAY_RANDOM_DIR_DEPTH", 1};
FlashParamNs::Parameter<uint32_t> P_CFG_MENU_IDX_GENERAL_TIME_TO_POWER_OFF {CFG_MENU_IDX_GENERAL_TIME_TO_POWER_OFF, "CFG_MENU_IDX_GENERAL_TIME_TO_POWER_OFF", 0};
FlashParamNs::Parameter<uint32_t> P_CFG_MENU_IDX_GENERAL_TIME_TO_LEAVE_CONFIG {CFG_MENU_IDX_GENERAL_TIME_TO_LEAVE_CONFIG, "CFG_MENU_IDX_GENERAL_TIME_TO_LEAVE_CONFIG", 1};
FlashParamNs::Parameter<uint32_t> P_CFG_MENU_IDX_GENERAL_PUSH_BUTTON_LAYOUT {CFG_MENU_IDX_GENERAL_PUSH_BUTTON_LAYOUT, "CFG_MENU_IDX_GENERAL_PUSH_BUTTON_LAYOUT", 0};
FlashParamNs::Parameter<uint32_t> P_CFG_MENU_IDX_GENERAL_HP_BUTTON_LAYOUT {CFG_MENU_IDX_GENERAL_HP_BUTTON_LAYOUT, "CFG_MENU_IDX_GENERAL_HP_BUTTON_LAYOUT", 1};
FlashParamNs::Parameter<uint32_t> P_CFG_MENU_IDX_DISPLAY_LCD_CONFIG {CFG_MENU_IDX_DISPLAY_LCD_CONFIG, "CFG_MENU_IDX_DISPLAY_LCD_CONFIG", 0};
FlashParamNs::Parameter<uint32_t> P_CFG_MENU_IDX_DISPLAY_ROTATION {CFG_MENU_IDX_DISPLAY_ROTATION, "CFG_MENU_IDX_DISPLAY_ROTATION", 0};
FlashParamNs::Parameter<uint32_t> P_CFG_MENU_IDX_DISPLAY_BACKLIGHT_LOW_LEVEL {CFG_MENU_IDX_DISPLAY_BACKLIGHT_LOW_LEVEL, "CFG_MENU_IDX_DISPLAY_BACKLIGHT_LOW_LEVEL", 7};
FlashParamNs::Parameter<uint32_t> P_CFG_MENU_IDX_DISPLAY_BACKLIGHT_HIGH_LEVEL {CFG_MENU_IDX_DISPLAY_BACKLIGHT_HIGH_LEVEL, "CFG_MENU_IDX_DISPLAY_BACKLIGHT_HIGH_LEVEL", 12};
FlashParamNs::Parameter<uint32_t> P_CFG_MENU_IDX_DISPLAY_TIME_TO_BACKLIGHT_LOW{CFG_MENU_IDX_DISPLAY_TIME_TO_BACKLIGHT_LOW, "CFG_MENU_IDX_DISPLAY_TIME_TO_BACKLIGHT_LOW", 1};
FlashParamNs::Parameter<uint32_t> P_CFG_MENU_IDX_PLAY_TIME_TO_NEXT_PLAY {CFG_MENU_IDX_PLAY_TIME_TO_NEXT_PLAY, "CFG_MENU_IDX_PLAY_TIME_TO_NEXT_PLAY", 2};
FlashParamNs::Parameter<uint32_t> P_CFG_MENU_IDX_PLAY_NEXT_PLAY_ALBUM {CFG_MENU_IDX_PLAY_NEXT_PLAY_ALBUM, "CFG_MENU_IDX_PLAY_NEXT_PLAY_ALBUM", 1};
FlashParamNs::Parameter<uint32_t> P_CFG_MENU_IDX_PLAY_RANDOM_DIR_DEPTH {CFG_MENU_IDX_PLAY_RANDOM_DIR_DEPTH, "CFG_MENU_IDX_PLAY_RANDOM_DIR_DEPTH", 1};
};
Loading

0 comments on commit 68e1da3

Please sign in to comment.