Skip to content
Open
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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,7 @@ __pycache__/

# Project
build/
ats-mini/build/

.gemini/
gha-creds-*.json
7 changes: 7 additions & 0 deletions ats-mini/Common.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,13 @@ extern uint8_t currentMode;
extern uint16_t currentCmd;
extern uint16_t currentBrt;
extern uint16_t currentSleep;
extern uint16_t currentSleepTimer;
extern uint32_t sleepTimerStart;
extern bool sleepTimerMuted;
extern uint8_t sleepModeIdx;
extern bool sleepSmart;
extern uint8_t sleepDayStart;
extern uint8_t sleepNightStart;
extern bool zoomMenu;
extern int8_t scrollDirection;
extern uint8_t utcOffsetIdx;
Expand Down Expand Up @@ -235,6 +241,7 @@ bool ntpSyncTime();

void netRequestConnect();
void netTickTime();
bool isSleepSmartActive(int &timeoutSeconds);

// Remote.c
#define REMOTE_CHANGED 1
Expand Down
22 changes: 22 additions & 0 deletions ats-mini/Draw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,28 @@ void drawBleIndicator(int x, int y)
}
}

//
// Draw Sleep Timer indicator
//
void drawSleepTimerIndicator(int x, int y)
{
if(currentSleepTimer > 0)
{
uint16_t color = TH.text_muted;

// Draw Zzz
// Big Z
spr.drawLine(x, y+2, x+6, y+2, color);
spr.drawLine(x+6, y+2, x, y+8, color);
spr.drawLine(x, y+8, x+6, y+8, color);

// Small z
spr.drawLine(x+8, y+7, x+12, y+7, color);
spr.drawLine(x+12, y+7, x+8, y+11, color);
spr.drawLine(x+8, y+11, x+12, y+11, color);
}
}

//
// Draw WiFi indicator
//
Expand Down
3 changes: 3 additions & 0 deletions ats-mini/Draw.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
#define WIFI_OFFSET_Y 0 // WiFi y offset
#define BLE_OFFSET_X 104 // BLE x offset
#define BLE_OFFSET_Y 0 // BLE y offset
#define SLEEP_OFFSET_X 120 // Sleep Timer x offset
#define SLEEP_OFFSET_Y 0 // Sleep Timer y offset

void drawMessage(const char *msg);
void drawZoomedMenu(const char *text, bool force = false);
Expand All @@ -40,6 +42,7 @@ void drawScreen(const char *statusLine1 = 0, const char *statusLine2 = 0);
void drawWiFiIndicator(int x, int y);
void drawSaveIndicator(int x, int y);
void drawBleIndicator(int x, int y);
void drawSleepTimerIndicator(int x, int y);
void drawBandAndMode(const char *band, const char *mode, int x, int y);
void drawFrequency(uint32_t freq, int x, int y, int ux, int uy, uint8_t hl);
void drawLongStationName(const char *name, int x, int y);
Expand Down
3 changes: 3 additions & 0 deletions ats-mini/Layout-Default.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ void drawLayoutDefault(const char *statusLine1, const char *statusLine2)
// Draw BLE icon
drawBleIndicator(BLE_OFFSET_X, BLE_OFFSET_Y);

// Draw Sleep Timer icon
drawSleepTimerIndicator(SLEEP_OFFSET_X, SLEEP_OFFSET_Y);

// Draw battery indicator & voltage
bool has_voltage = drawBattery(BATT_OFFSET_X, BATT_OFFSET_Y);

Expand Down
3 changes: 3 additions & 0 deletions ats-mini/Layout-SMeter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,9 @@ void drawLayoutSmeter(const char *statusLine1, const char *statusLine2)
// Draw BLE icon
drawBleIndicator(BLE_OFFSET_X, BLE_OFFSET_Y);

// Draw Sleep Timer icon
drawSleepTimerIndicator(SLEEP_OFFSET_X, SLEEP_OFFSET_Y);

// Draw battery indicator & voltage
bool has_voltage = drawBattery(BATT_OFFSET_X, BATT_OFFSET_Y);

Expand Down
Loading