dasdgw / yoradio

Web-radio based on ESP32-audioI2S library
GNU General Public License v3.0
1 stars 1 forks source link

a lot of repeated warnings for environment ESP32-miniwebradio-S3 #9

Closed frankalicious closed 18 hours ago

frankalicious commented 1 week ago

Latest commit in esp32-audioI2S-3.0.9i.
Clean git repo.
I'm not sure which pin creates these error.

$ rm -rf .pio
$ pio run -e ESP32-miniwebradio-S3 -t upload
$ pio run -e ESP32-miniwebradio-S3 -t monitor
Build:Mar 27 2021
rst:0x1 (POWERON),boot:0x28 (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce3818,len:0x508
load:0x403c9700,len:0x4
load:0x403c9704,len:0xad0
load:0x403cc700,len:0x29d8
entry 0x403c9880
[   312][E][esp32-hal-gpio.c:107] __pinMode(): Invalid IO 255 selected
[   319][E][esp32-hal-gpio.c:107] __pinMode(): Invalid IO 255 selected
[   327][E][esp32-hal-gpio.c:107] __pinMode(): Invalid IO 255 selected
[   334][E][esp32-hal-gpio.c:107] __pinMode(): Invalid IO 255 selected
[   341][E][esp32-hal-gpio.c:107] __pinMode(): Invalid IO 255 selected
[   348][E][esp32-hal-gpio.c:107] __pinMode(): Invalid IO 255 selected
[   356][E][esp32-hal-gpio.c:107] __pinMode(): Invalid IO 255 selected
Time to wake up neo!
##[BOOT]#       ************************************************
##[BOOT]#       *               ёRadio 5d129c62                *
##[BOOT]#       ************************************************
##[BOOT]#       ------------------------------------------------
##[BOOT]#       arduino:        10812
##[BOOT]#       compiler:       12.2.0
##[BOOT]#       esp32core:      3.0.0
##[BOOT]#       chip:           model: ESP32-S3 | rev: 2 | id: 13461688 | cores: 2 | psram: 8388608
##[BOOT]#       display:        model=21 cs=8 dc=12 rst=-1
##[BOOT]#       audio:          I2S (9, 3, 1)
##[BOOT]#       audioinfo:      false
##[BOOT]#       smartstart:     2
##[BOOT]#       vumeter:        true
##[BOOT]#       softapdelay:    0
##[BOOT]#       flipscreen:     false
##[BOOT]#       invertdisplay:  false
##[BOOT]#       showweather:    false
##[BOOT]#       buttons:        left=255, center=255, right=255, up=255, down=255, mode=255, pullup=true
##[BOOT]#       encoders:       l1=5, b1=7, r1=6, pullup=true, l2=255, b2=255, r2=255, pullup=true
##[BOOT]#       ir:             255
##[BOOT]#       ------------------------------------------------
##[BOOT]#       SPIFFS mounted
##[BOOT]#       display.init    done
##[BOOT]#       player.init     done
##[BOOT]#       network.begin
##[BOOT]#       Attempt to connect to Batcave
##[BOOT]#       ..
##[BOOT]#       done
##[BOOT]#       netserver.begin done
##[BOOT]#       telnet.begin    done
##[BOOT]#
##[BOOT]#       Ready! Go to http:/192.168.0.229/ to configure
##[BOOT]#       ------------------------------------------------
##[BOOT]#
##CLI.META#: [ready]
[  2408][E][esp32-hal-periman.c:174] perimanGetPinBus(): Invalid pin: 255
[  2415][E][esp32-hal-gpio.c:188] __digitalRead(): IO 255 is not set as GPIO.
[  2424][E][esp32-hal-periman.c:174] perimanGetPinBus(): Invalid pin: 255
[  2432][E][esp32-hal-gpio.c:188] __digitalRead(): IO 255 is not set as GPIO.
frankalicious commented 1 week ago

If one button is active https://github.com/dasdgw/yoradio/blob/5d129c623c6b50a69bf8988753f4a0c9a5b0c970/yoRadio/src/core/controls.cpp#L14

A global array button of OneButton classes is initialized https://github.com/dasdgw/yoradio/blob/5d129c623c6b50a69bf8988753f4a0c9a5b0c970/yoRadio/src/core/controls.cpp#L17

This creates an error during because the pinMode is set with an invalid pun number https://github.com/dasdgw/yoradio/blob/5d129c623c6b50a69bf8988753f4a0c9a5b0c970/yoRadio/src/OneButton/OneButton.cpp#L53


In the loop there is a problem because BTN_MODE is missing in the for loop. https://github.com/dasdgw/yoradio/blob/5d129c623c6b50a69bf8988753f4a0c9a5b0c970/yoRadio/src/core/controls.cpp#L145 It should be added as here https://github.com/dasdgw/yoradio/blob/5d129c623c6b50a69bf8988753f4a0c9a5b0c970/yoRadio/src/core/controls.cpp#L101

dasdgw commented 1 week ago

We could also try to only add a button instance if the pin is not defined to 255. If I add an ifdef around a button instance like:

#if (BTN_LEFT!=255)
  {BTN_LEFT, true, BTN_INTERNALPULLUP},
#endif

I get __pinMode(): Invalid IO 255 selected only 6 times on startup. But it's a little bit ugly. And I failed trying to put this in a macro.

frankalicious commented 1 week ago

We could also try to only add a button instance if the pin is not defined to 255. If I add an ifdef around a button instance like:

#if (BTN_LEFT!=255)
  {BTN_LEFT, true, BTN_INTERNALPULLUP},
#endif

I get __pinMode(): Invalid IO 255 selected only 6 times on startup. But it's a little bit ugly. And I failed trying to put this in a macro.

That's what I tried but I may forgot the brackets so I could not compile it. I think that's my preffered solution because we could also remove the check in the loop.

frankalicious commented 1 week ago

I found my problem. I tried to put the 3 lines in 1 line and that does not work.

Nevertheless I think it's not so easy to reduce the size of the button array.
In initControls() the parameter for the functions called by the callback are using the id as parameter. (e.g. void onBtnClick(int id) {
They have a fixed value from the enum controlEvt_e.

frankalicious commented 18 hours ago

Closed by ccca082.