Skip to content

Add task to control ESP led#27

Merged
ToveRumar merged 5 commits intomainfrom
toverumar/wifi_led_ctrl_task
Feb 12, 2025
Merged

Add task to control ESP led#27
ToveRumar merged 5 commits intomainfrom
toverumar/wifi_led_ctrl_task

Conversation

@ToveRumar
Copy link
Contributor

While not connected to a client socket the led will blink 2 times/sec.
Once connected it will be on while sending and off while doing anything else like waiting for an image etc

@ToveRumar ToveRumar force-pushed the toverumar/wifi_led_ctrl_task branch 2 times, most recently from dd11fa6 to 63dc3fd Compare February 11, 2025 15:05
Slow blink when not connected and then on while sending and off while doing other things.

The solution with two bits, one for send and one for done sending is needed since
there is no way to wait for a bit to be cleared (except polling).
We need to wait with setting the sent bit in the sending thread until we are all done
i.e closing any sockets or similar. Otherwise the wait function in the led task will wait indefinitely
Define -1 descriptor as not connected for ease of reading
This is more what it actually signals. I.e do other non-send related things while waiting to send next packet.
We need to flag these bits once the socket is actually fully closed for the led task to work correctly
This will lead to the wrong part of the picture being sent when reconnecting a socket
@ToveRumar ToveRumar force-pushed the toverumar/wifi_led_ctrl_task branch from 6395381 to 39dfcfb Compare February 12, 2025 09:00
@ToveRumar ToveRumar merged commit 467a64c into main Feb 12, 2025
1 check passed
@ToveRumar ToveRumar deleted the toverumar/wifi_led_ctrl_task branch February 12, 2025 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants