Skip to content

Commit

Permalink
Feature flag the scroll text functionality only for big clocks
Browse files Browse the repository at this point in the history
  • Loading branch information
akasaka committed Dec 17, 2024
1 parent 6b6b359 commit e3f62d0
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 14 deletions.
26 changes: 15 additions & 11 deletions include/device_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,27 @@
// DEPRECATED: Enable Wii Balance Board measuring. UNSTABLE: Uses Bluedroid (a FUCKTON of RAM), periodic disconnects or reboots without leaving a stack trace.
// #define HAS_BALANCE_BOARD_INTEGRATION

// WIP: Pixel Cave the game
// #define HAS_PIXEL_CAVE

// Enable serial MIDI input
// #define HAS_SERIAL_MIDI

// Enable the yukkuri voice talking clock
#ifdef LIBAQUESTALK_FOUND
#define HAS_AQUESTALK
#else
#warning "Lib AquesTalk not found, TTS disabled"
#warning "AquesTalk not found, TTS disabled. See `./lib/nonfree-aquestalk/README.md` on how to add the library correctly."
#endif

// Enable the split-screen app host, only useful on long screens
#if HWCONF_DISPLAY_WIDTH_PX >= 192
#define HAS_SPLIT_SCREEN_APPHOST
#endif

// Enable the scroll string between cycles
// #define HAS_FREE_TEXT_SCROLL

// Disable the faux brightness reduction for some UI elements by drawing them only every other frame
// #define COMPOSABLE_NO_EVENODD

Expand Down Expand Up @@ -81,14 +95,4 @@
#endif
#endif

#if HAS(AQUESTALK)
#if !defined(LIBAQUESTALK_FOUND)
#error libaquestalk was not found. See `./lib/nonfree-aquestalk/README.md` on how to add it correctly, or disable `HAS_AQUESTALK` feature flag.
#endif
#endif

#if HWCONF_DISPLAY_WIDTH_PX >= 192
#define HAS_SPLIT_SCREEN_APPHOST
#endif

#endif
1 change: 1 addition & 0 deletions include/devices/big_clock.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#define HAS_TEMP_SENSOR
#define HAS_MOTION_SENSOR
#define HAS_KEYPAD
#define HAS_FREE_TEXT_SCROLL

// Plasma Information System OS (not DOS, there's no disk in it!)
#define PRODUCT_NAME "PIS-OS"
Expand Down
1 change: 1 addition & 0 deletions include/devices/big_noritake.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#define HAS_TEMP_SENSOR
#define HAS_IR_RECEIVER
#define HAS_OTAFVU
#define HAS_FREE_TEXT_SCROLL

// Plasma Information System OS (not DOS, there's no disk in it!)
#define PRODUCT_NAME "LongPIS-OS"
Expand Down
1 change: 1 addition & 0 deletions include/devices/led_clock.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#define HAS_VARYING_BRIGHTNESS
#define HAS_LIGHT_SENSOR
#define HAS_IR_RECEIVER
#define HAS_FREE_TEXT_SCROLL

// Plasma Information System OS (not DOS, there's no disk in it!)
#define PRODUCT_NAME "LePIS-OS"
Expand Down
3 changes: 3 additions & 0 deletions include/devices/mid_clock_noritake_wide.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
#define HAS_SERIAL_MIDI
#define HAS_VARYING_BRIGHTNESS
#define HAS_LIGHT_SENSOR

// For Dev, not useful yet
#define HAS_PIXEL_CAVE
#define HAS_FREE_TEXT_SCROLL

// Plasma Information System OS (not DOS, there's no disk in it!)
#define PRODUCT_NAME "PIS-dev"
Expand Down
10 changes: 7 additions & 3 deletions src/app/idle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ typedef enum MainViewId: uint16_t {
VIEW_WORD_OF_THE_DAY,
#endif
VIEW_FB2K,
#if HAS(FREE_TEXT_SCROLL)
VIEW_FREE_TEXT,
#endif

VIEW_MAX
} MainViewId_t;
Expand Down Expand Up @@ -94,7 +96,6 @@ static WeatherPressureChart * pressureView;
static WordOfTheDayView * wotdView;
#endif
static Fb2kView *fb2kView;
static FreeTextView *freeTextView;

static ViewMultiplexor * slideShow;

Expand Down Expand Up @@ -272,7 +273,9 @@ void app_idle_init(SensorPool* s, Beeper* b, NewSequencer* seq, Yukkuri* tts) {

screen_times_ms[VIEW_SOFTAP] = 30000;
screen_times_ms[VIEW_FVU_NOTICE] = 10000;
#if HAS(FREE_TEXT_SCROLL)
screen_times_ms[VIEW_FREE_TEXT] = 1000;
#endif
screen_times_ms[VIEW_CLOCK] = prefs_get_int(PREFS_KEY_SCRN_TIME_CLOCK_SECONDS) * 1000;
screen_times_ms[VIEW_NEXT_ALARM] = prefs_get_int(PREFS_KEY_SCRN_TIME_NEXT_ALARM_SECONDS) * 1000;
#if HAS(TEMP_SENSOR)
Expand Down Expand Up @@ -315,7 +318,6 @@ void app_idle_init(SensorPool* s, Beeper* b, NewSequencer* seq, Yukkuri* tts) {
fb2kView = new Fb2kView();
nextAlarmView = new NextAlarmView();
softApView = new SoftApInfoView();
freeTextView = new FreeTextView();

touchArrows = new TouchArrowOverlay();
touchArrows->bottom = true;
Expand Down Expand Up @@ -351,7 +353,9 @@ void app_idle_init(SensorPool* s, Beeper* b, NewSequencer* seq, Yukkuri* tts) {
slideShow->add_view(wotdView, VIEW_WORD_OF_THE_DAY);
#endif
slideShow->add_view(fb2kView, VIEW_FB2K);
slideShow->add_view(freeTextView, VIEW_FREE_TEXT);
#if HAS(FREE_TEXT_SCROLL)
slideShow->add_view(new FreeTextView(), VIEW_FREE_TEXT);
#endif

lastScreenSwitch = xTaskGetTickCount();

Expand Down
2 changes: 2 additions & 0 deletions src/network/admin_panel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@ static void build() {
GP.SPOILER_END();
GP.BREAK();

#if HAS(FREE_TEXT_SCROLL)
GP.SPOILER_BEGIN("Free Text", GP_BLUE);
GP.SPAN("Enter multiple lines of text to show between cycles, separating them with the Enter key.");
GP.AREA(PREFS_KEY_FREE_TEXT_STRING, 4, prefs_get_string(PREFS_KEY_FREE_TEXT_STRING));
Expand All @@ -461,6 +462,7 @@ static void build() {
GP.SELECT(PREFS_KEY_FREE_TEXT_RANDOM, "Sequential,Randomize", prefs_get_int(PREFS_KEY_FREE_TEXT_RANDOM));
GP.SPOILER_END();
GP.BREAK();
#endif

GP.SPOILER_BEGIN("Power Management", GP_BLUE);
#if HAS(VARYING_BRIGHTNESS) && HAS(LIGHT_SENSOR)
Expand Down

0 comments on commit e3f62d0

Please sign in to comment.