Skip to content

Commit

Permalink
1.84 release
Browse files Browse the repository at this point in the history
  • Loading branch information
Fujix1 committed Dec 31, 2024
1 parent 985aff4 commit 379fe6f
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 35 deletions.
7 changes: 4 additions & 3 deletions src/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ bool NDConfig::init() {
{FO_0, FO_2, FO_5, FO_8, FO_10, FO_12, FO_15}});

items.push_back({0, "画面更新", "LCD Update", {"する", "しない"}, {"On", "Off"}, {UPDATE_YES, UPDATE_NO}});
items.push_back(
/*items.push_back(
{0, "動作モード", "Mode", {"プレーヤー", "シリアル"}, {"Player", "Serial"}, {MODE_PLAYER, MODE_SERIAL}});

*/
if (!SPIFFS.begin(true)) {
return false;
}
Expand Down Expand Up @@ -115,13 +115,14 @@ void NDConfig::loadCfg() {
}
}
file.close();

/*
// 現在の動作モード
if (items.size() > CFG_MODE) {
currentMode = (tMode)items[CFG_MODE].index;
} else {
currentMode = MODE_PLAYER;
}
*/
}

// 最後に開いたフォルダ番号の照合
Expand Down
2 changes: 1 addition & 1 deletion src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ typedef enum {
CFG_HISTORY, // 起動時復旧
CFG_FADEOUT, // フェードアウト時間
CFG_UPDATE, // 画面更新有無
CFG_MODE, // 動作モード
// CFG_MODE, // 動作モード
} tConfig;

// 設定用構造体
Expand Down
63 changes: 32 additions & 31 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ void setup() {

lcd.setFont(&fonts::Font2);
lcd.println("NANO DRIVE 6");
lcd.println("2024 Fujix@e2j.net");
lcd.printf("Firmware: 1.83\n\n");
lcd.println("2024, 2025 Fujix@e2j.net");
lcd.printf("Firmware: 1.84\n\n");

// PSRAM 初期化確認
if (psramInit()) {
Expand Down Expand Up @@ -99,39 +99,40 @@ void setup() {
FM.reset();

// 動作切り替え
if (ndConfig.currentMode == MODE_PLAYER) {
// SD読み込み
if (ndFile.init() == true) {
ndFile.listDir("/");
} else {
exit;
}
// if (ndConfig.currentMode == MODE_PLAYER) {
// SD読み込み
if (ndFile.init() == true) {
ndFile.listDir("/");
} else {
exit;
}

// ファイル数確認
if (ndFile.totalSongs == 0) {
lcd.printf("ERROR: No file to play on the SD.\n");
exit;
}
// ファイル数確認
if (ndFile.totalSongs == 0) {
lcd.printf("ERROR: No file to play on the SD.\n");
exit;
}

// 読み込み履歴復元
u16_t lastDirIndex = 0, lastTrackIndex = 0;
u32_t history = ndConfig.loadHistory();
lastDirIndex = history & 0xffff;
lastTrackIndex = (history & 0xffff0000) >> 16;

switch (ndConfig.get(CFG_HISTORY)) {
case HISTORY_FOLDER:
ndFile.dirPlay(lastDirIndex);
break;
case HISTORY_FILE:
ndFile.play(lastDirIndex, lastTrackIndex);
break;
default:
ndFile.dirPlay(0);
}
} else {
// 読み込み履歴復元
u16_t lastDirIndex = 0, lastTrackIndex = 0;
u32_t history = ndConfig.loadHistory();
lastDirIndex = history & 0xffff;
lastTrackIndex = (history & 0xffff0000) >> 16;

switch (ndConfig.get(CFG_HISTORY)) {
case HISTORY_FOLDER:
ndFile.dirPlay(lastDirIndex);
break;
case HISTORY_FILE:
ndFile.play(lastDirIndex, lastTrackIndex);
break;
default:
ndFile.dirPlay(0);
}
/*} else {
lcd.printf("Entering Serial Mode.\n");
}
*/

// 入力有効化
input.init();
Expand Down

0 comments on commit 379fe6f

Please sign in to comment.