Skip to content

Commit d219335

Browse files
committed
n5110_crash_fix_127
1 parent 4c9f1bd commit d219335

File tree

8 files changed

+21
-9
lines changed

8 files changed

+21
-9
lines changed

yoRadio/src/AsyncWebServer/AsyncTCP.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ static inline bool _init_async_event_queue(){
104104
}
105105

106106
static inline bool _send_async_event(lwip_event_packet_t ** e){
107-
return _async_queue && xQueueSend(_async_queue, e, portMAX_DELAY) == pdPASS;
107+
return _async_queue && xQueueSend(_async_queue, e, SEND_ASYNC_EVENT_DELAY) == pdPASS;
108108
}
109109

110110
static inline bool _prepend_async_event(lwip_event_packet_t ** e){

yoRadio/src/AsyncWebServer/AsyncTCP.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ extern "C" {
4646
#ifndef XQUEUE_SIZE
4747
#define XQUEUE_SIZE 128 // (32)
4848
#endif
49-
49+
#ifndef SEND_ASYNC_EVENT_DELAY
50+
#define SEND_ASYNC_EVENT_DELAY portMAX_DELAY
51+
#endif
5052
class AsyncClient;
5153

5254
#define ASYNC_MAX_ACK_TIME 5000

yoRadio/src/core/options.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef options_h
22
#define options_h
33

4-
#define YOVERSION "0.9.122"
4+
#define YOVERSION "0.9.127"
55

66
/*******************************************************
77
DO NOT EDIT THIS FILE.
@@ -257,6 +257,9 @@ The connection tables are located here https://github.com/e2002/yoradio#connecti
257257
#ifndef MUTE_VAL
258258
#define MUTE_VAL HIGH // Write this to MUTE_PIN when player is stopped
259259
#endif
260+
#ifndef MUTE_LOCK
261+
#define MUTE_LOCK false // for vs1053 Shield rev2 - lock MUTE_PIN to !MUTE_VAL
262+
#endif
260263
#ifndef BRIGHTNESS_PIN
261264
#define BRIGHTNESS_PIN 255 // BRIGHTNESS Pin
262265
#endif

yoRadio/src/core/player.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ void Player::init() {
3737
Serial.print("##[BOOT]#\tplayer.init\t");
3838
playerQueue=NULL;
3939
playerQueue = xQueueCreate( 5, sizeof( playerRequestParams_t ) );
40-
40+
setOutputPins(false);
41+
delay(50);
4142
memset(_plError, 0, PLERR_LN);
4243
#ifdef MQTT_ROOT_TOPIC
4344
memset(burl, 0, MQTT_BURL_SIZE);
@@ -56,7 +57,7 @@ void Player::init() {
5657
setTone(config.store.bass, config.store.middle, config.store.trebble);
5758
setVolume(0);
5859
_status = STOPPED;
59-
setOutputPins(false);
60+
//setOutputPins(false);
6061
_volTimer=false;
6162
playmutex = xSemaphoreCreateMutex();
6263
randomSeed(analogRead(0));
@@ -159,7 +160,8 @@ void Player::loop() {
159160

160161
void Player::setOutputPins(bool isPlaying) {
161162
if(LED_BUILTIN!=255) digitalWrite(LED_BUILTIN, LED_INVERT?!isPlaying:isPlaying);
162-
if(MUTE_PIN!=255) digitalWrite(MUTE_PIN, isPlaying?!MUTE_VAL:MUTE_VAL);
163+
bool _ml = MUTE_LOCK?!MUTE_VAL:(isPlaying?!MUTE_VAL:MUTE_VAL);
164+
if(MUTE_PIN!=255) digitalWrite(MUTE_PIN, _ml);
163165
}
164166

165167
void Player::_play(uint16_t stationId) {

yoRadio/src/displays/conf/displayLCD2004conf.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
More info on https://github.com/e2002/yoradio/wiki/Widgets#widgets-description
66
*************************************************************************************/
77

8-
#ifndef displayLCD1602conf_h
9-
#define displayLCD1602conf_h
8+
#ifndef displayLCD2004conf_h
9+
#define displayLCD2004conf_h
1010

1111
#define DSP_WIDTH 20
1212
#define TFT_FRAMEWDT 0

yoRadio/src/displays/displayN5110.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,9 @@ void DspCore::clearClock(){
180180

181181

182182
void DspCore::loop(bool force) {
183+
if(digitalRead(TFT_CS)==LOW) return;
183184
display();
184-
delay(5);
185+
delay(10);
185186
}
186187

187188
void DspCore::charSize(uint8_t textsize, uint8_t& width, uint16_t& height){

yoRadio/src/displays/widgets/widgets.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,9 @@ void SliderWidget::_clear() {
265265
// _oldvalwidth = 0;
266266
dsp.fillRect(_config.left, _config.top, _width, _height, _bgcolor);
267267
}
268+
void SliderWidget::_reset() {
269+
_oldvalwidth = 0;
270+
}
268271
/************************
269272
VU WIDGET
270273
************************/

yoRadio/src/displays/widgets/widgets.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ class SliderWidget: public Widget {
191191
void _draw();
192192
void _drawslider();
193193
void _clear();
194+
void _reset();
194195
};
195196

196197
class VuWidget: public Widget {

0 commit comments

Comments
 (0)