mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2026-01-31 14:51:11 +03:00
brightness
This commit is contained in:
@@ -106,6 +106,8 @@ static bool display_handler(u8_t *data, int len){
|
|||||||
handle->vfdc_handler(data, len);
|
handle->vfdc_handler(data, len);
|
||||||
} else if (!strncmp((char*) data, "grfe", 4)) {
|
} else if (!strncmp((char*) data, "grfe", 4)) {
|
||||||
handle->grfe_handler(data, len);
|
handle->grfe_handler(data, len);
|
||||||
|
} else if (!strncmp((char*) data, "grfb", 4)) {
|
||||||
|
handle->grfb_handler(data, len);
|
||||||
} else {
|
} else {
|
||||||
res = false;
|
res = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ static const char *TAG = "display";
|
|||||||
|
|
||||||
static void vfdc_handler( u8_t *_data, int bytes_read);
|
static void vfdc_handler( u8_t *_data, int bytes_read);
|
||||||
static void grfe_handler( u8_t *data, int len);
|
static void grfe_handler( u8_t *data, int len);
|
||||||
|
static void grfb_handler( u8_t *data, int len);
|
||||||
static bool display_init(char *config, char *welcome);
|
static bool display_init(char *config, char *welcome);
|
||||||
static void print_message(char *msg);
|
static void print_message(char *msg);
|
||||||
|
|
||||||
@@ -44,6 +45,7 @@ struct display_handle_s SSD1306_handle = {
|
|||||||
print_message,
|
print_message,
|
||||||
vfdc_handler,
|
vfdc_handler,
|
||||||
grfe_handler,
|
grfe_handler,
|
||||||
|
grfb_handler,
|
||||||
NULL, NULL,
|
NULL, NULL,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -243,7 +245,7 @@ static void vfdc_handler( u8_t *_data, int bytes_read) {
|
|||||||
/****************************************************************************************
|
/****************************************************************************************
|
||||||
* Process graphic display data
|
* Process graphic display data
|
||||||
*/
|
*/
|
||||||
void grfe_handler( u8_t *data, int len) {
|
static void grfe_handler( u8_t *data, int len) {
|
||||||
data += 8;
|
data += 8;
|
||||||
len -= 8;
|
len -= 8;
|
||||||
|
|
||||||
@@ -293,4 +295,20 @@ void grfe_handler( u8_t *data, int len) {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/****************************************************************************************
|
||||||
|
* Process graphic display data
|
||||||
|
*/
|
||||||
|
static void grfb_handler(u8_t *data, int len) {
|
||||||
|
s16_t brightness = htons(*(uint16_t*) (data + 4));
|
||||||
|
|
||||||
|
ESP_LOGI(TAG, "brightness %hx", brightness);
|
||||||
|
if (brightness < 0) {
|
||||||
|
SSD1306_DisplayOff( &Display );
|
||||||
|
} else {
|
||||||
|
SSD1306_DisplayOn( &Display );
|
||||||
|
SSD1306_SetContrast( &Display, brightness * 256 / 4 - 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
@@ -57,6 +57,10 @@ sub nmodes {
|
|||||||
# pattern than the 32 pixels version, where one would have expected bytes 4..7
|
# pattern than the 32 pixels version, where one would have expected bytes 4..7
|
||||||
# to be empty
|
# to be empty
|
||||||
|
|
||||||
|
sub brightnessMap {
|
||||||
|
return (65535, 1, 2, 3, 4);
|
||||||
|
}
|
||||||
|
|
||||||
=comment
|
=comment
|
||||||
sub bytesPerColumn {
|
sub bytesPerColumn {
|
||||||
return 4;
|
return 4;
|
||||||
|
|||||||
@@ -10,6 +10,6 @@
|
|||||||
<name>PLUGIN_SQUEEZEESP32</name>
|
<name>PLUGIN_SQUEEZEESP32</name>
|
||||||
<description>PLUGIN_SQUEEZEESP32_DESC</description>
|
<description>PLUGIN_SQUEEZEESP32_DESC</description>
|
||||||
<module>Plugins::SqueezeESP32::Plugin</module>
|
<module>Plugins::SqueezeESP32::Plugin</module>
|
||||||
<version>0.4</version>
|
<version>0.5</version>
|
||||||
<creator>Philippe</creator>
|
<creator>Philippe</creator>
|
||||||
</extensions>
|
</extensions>
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
<?xml version='1.0' standalone='yes'?>
|
<?xml version='1.0' standalone='yes'?>
|
||||||
<extensions>
|
<extensions>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin version="0.4" name="SqueezeESP32" minTarget="7.9" maxTarget="7.*">
|
<plugin version="0.5" name="SqueezeESP32" minTarget="7.9" maxTarget="7.*">
|
||||||
<link>https://github.com/sle118/squeezelite-esp32</link>
|
<link>https://github.com/sle118/squeezelite-esp32</link>
|
||||||
<creator>Philippe</creator>
|
<creator>Philippe</creator>
|
||||||
<sha>cec20d0489ed120d56ea2de836c616c7d970c0d5</sha>
|
<sha>479c0a88d9c3b645abd98a6b8075f33e048ce4ce</sha>
|
||||||
<email>philippe_44@outlook.com</email>
|
<email>philippe_44@outlook.com</email>
|
||||||
<desc lang="EN">SqueezeESP32 additional player id (100)</desc>
|
<desc lang="EN">SqueezeESP32 additional player id (100)</desc>
|
||||||
<url>http://github.com/sle118/squeezelite-esp32/raw/master/plugin/SqueezeESP32.zip</url>
|
<url>http://github.com/sle118/squeezelite-esp32/raw/master/plugin/SqueezeESP32.zip</url>
|
||||||
|
|||||||
Reference in New Issue
Block a user