libretiny-eu / libretiny

PlatformIO development platform for IoT modules
http://docs.libretiny.eu/
MIT License
382 stars 55 forks source link

[realtek-ambz] Fix crash after WiFi scan #258

Closed hn closed 4 months ago

hn commented 4 months ago
[C][wifi:038]: Setting up WiFi...
[C][wifi:051]: Starting WiFi...
[C][wifi:052]:   Local MAC: 80:A0:36:A7:F7:1F
interface 0 is initialized
                          interface 1 is initialized

Initializing WIFI ...
WIFI initialized
                [D][wifi:459]: Starting scan...
RTL8195A[HAL]: Hard Fault Error!!!!
RTL8195A[HAL]: R0 = 0x1b9

As explained by @kuba2k2: "It seems that scanAlloc() returns the amount of allocated items, then the Realtek code tries to assign to the last item. The index in [] is wrong though, it tries to assign to one item past the last one."

Fixes #257

kuba2k2 commented 4 months ago

Perfect :slightly_smiling_face: