-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
39 changed files
with
644 additions
and
380 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#ifndef _my_theme_h | ||
#define _my_theme_h | ||
|
||
/* | ||
Theming of color displays | ||
DSP_ST7735, DSP_ST7789, DSP_ILI9341, DSP_GC9106, DSP_ILI9225, DSP_ST7789_240 | ||
*********************************************************************** | ||
* !!! This file must be in the root directory of the sketch !!! * | ||
*********************************************************************** | ||
Uncomment (remove double slash //) from desired line to apply color | ||
*/ | ||
#define ENABLE_THEME | ||
#ifdef ENABLE_THEME | ||
|
||
/*----------------------------------------------------------------------------------------------------------------*/ | ||
/* | COLORS | values (0-255) | */ | ||
/* | color name | R G B | */ | ||
/*----------------------------------------------------------------------------------------------------------------*/ | ||
//#define COLOR_BACKGROUND 255, 255, 0 /* background */ | ||
//#define COLOR_STATION_NAME 91, 118, 255 /* station name */ | ||
//#define COLOR_SNG_TITLE_1 255, 0, 0 /* first title */ | ||
//#define COLOR_SNG_TITLE_2 0, 0, 0 /* second title */ | ||
//#define COLOR_WEATHER 255, 0, 216 /* weather string */ | ||
//#define COLOR_VU_MAX 152, 138, 138 /* max of VU meter */ | ||
//#define COLOR_VU_MIN 250, 130, 130 /* min of VU meter */ | ||
//#define COLOR_CLOCK 60, 224, 33 /* clock color */ | ||
//#define COLOR_SECONDS 0, 255, 255 /* seconds color (DSP_ST7789, DSP_ILI9341, DSP_ILI9225) */ | ||
//#define COLOR_DAY_OF_W 255, 0, 0 /* day of week color (DSP_ST7789, DSP_ILI9341, DSP_ILI9225) */ | ||
//#define COLOR_DATE 0, 0, 255 /* date color (DSP_ST7789, DSP_ILI9341, DSP_ILI9225) */ | ||
//#define COLOR_HEAP 255, 168, 162 /* heap string */ | ||
//#define COLOR_BUFFER 157, 171, 251 /* buffer line */ | ||
//#define COLOR_IP 41, 189, 207 /* ip address */ | ||
//#define COLOR_VOLUME_VALUE 165, 162, 132 /* volume string (DSP_ST7789, DSP_ILI9341, DSP_ILI9225) */ | ||
//#define COLOR_RSSI 255, 148, 156 /* rssi */ | ||
//#define COLOR_VOLBAR_OUT 198, 93, 0 /* volume bar outline */ | ||
//#define COLOR_VOLBAR_IN 189, 189, 189 /* volume bar fill */ | ||
//#define COLOR_DIGITS 100, 100, 255 /* volume / station number */ | ||
//#define COLOR_DIVIDER 0, 255, 0 /* divider color (DSP_ST7789, DSP_ILI9341, DSP_ILI9225) */ | ||
//#define COLOR_PLAYLIST_0 255, 0, 0 /* playlist string 0 */ | ||
//#define COLOR_PLAYLIST_1 0, 255, 0 /* playlist string 1 */ | ||
//#define COLOR_PLAYLIST_2 255, 0, 255 /* playlist string 2 */ | ||
//#define COLOR_PLAYLIST_3 0, 0, 255 /* playlist string 3 */ | ||
//#define COLOR_PLAYLIST_4 0, 255, 255 /* playlist string 4 */ | ||
|
||
|
||
#endif /* #ifdef ENABLE_THEME */ | ||
#endif /* #define _my_theme_h */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,36 @@ | ||
/************************************************************** | ||
/****************************************************************************************************************** | ||
Example of esp32 deep sleep when playback is stopped. | ||
This file must be in the root directory of the sketch. | ||
**************************************************************/ | ||
#define SLEEP_DELAY 60 // 1 min | ||
#define WAKEUP_PIN_1 GPIO_NUM_12 | ||
#define WAKEUP_LEVEL LOW | ||
*******************************************************************************************************************/ | ||
#define SLEEP_DELAY 60 /* 1 min deep sleep delay */ | ||
#define WAKEUP_PIN ENC_BTNB /* wakeup pin (one of: BTN_XXXX, ENC_BTNB, ENC2_BTNB) */ | ||
/* must be one of: 0,2,4,12,13,14,15,25,26,27,32,33,34,35,36,39 */ | ||
#define WAKEUP_LEVEL LOW /* wakeup level (usually LOW) */ | ||
|
||
#if WAKEUP_PIN!=255 | ||
Ticker deepSleepTicker; | ||
|
||
void goToSleep(){ | ||
if(BRIGHTNESS_PIN!=255) analogWrite(BRIGHTNESS_PIN, 0); /* BRIGHTNESS_PIN added in v0.7.330 */ | ||
esp_deep_sleep_start(); | ||
if(BRIGHTNESS_PIN!=255) analogWrite(BRIGHTNESS_PIN, 0); /* BRIGHTNESS_PIN added in v0.7.330 */ | ||
if(display.deepsleep()) { /* if deep sleep is possible */ | ||
esp_deep_sleep_start(); /* go to sleep */ | ||
}else{ /* else */ | ||
deepSleepTicker.detach(); /* detach the timer */ | ||
} | ||
} | ||
|
||
void yoradio_on_setup(){ | ||
esp_sleep_enable_ext0_wakeup(WAKEUP_PIN_1, WAKEUP_LEVEL); | ||
deepSleepTicker.attach(SLEEP_DELAY, goToSleep); | ||
void yoradio_on_setup(){ /* occurs during loading */ | ||
esp_sleep_enable_ext0_wakeup((gpio_num_t)WAKEUP_PIN, WAKEUP_LEVEL); /* enable wakeup pin */ | ||
deepSleepTicker.attach(SLEEP_DELAY, goToSleep); /* attach to delay */ | ||
} | ||
|
||
void player_on_start_play(){ | ||
deepSleepTicker.detach(); | ||
void player_on_start_play(){ /* occurs during player is start playing */ | ||
deepSleepTicker.detach(); /* detach the timer */ | ||
} | ||
|
||
void player_on_stop_play(){ | ||
deepSleepTicker.attach(SLEEP_DELAY, goToSleep); | ||
void player_on_stop_play(){ /* occurs during player is stop playing */ | ||
deepSleepTicker.attach(SLEEP_DELAY, goToSleep); /* attach to delay */ | ||
} | ||
#endif /* #if WAKEUP_PIN!=255 */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.