Close

Updated ring buffer code

A project log for Bluetooth Low Energy Receiver for NES Controller

Hardware that adds a BLE interface to the NES controller port

zachary-murtishiZachary Murtishi 12/08/2024 at 22:000 Comments

I was attempting to lift my ring buffer code from this project for a different, AVR-based project, only to find that the ring buffer did not work as intended in that application. I discovered a bug in the pop() function in which the head variable is not properly updated prior to retrieving information from the ring buffer i.e. head should be decremented prior to retrieving data. This has been fixed and the source file in the files section has been updated to reflect this change.

I also corrected some faulty timer interrupt logic, which resulted in the timeout always kicking in and resetting the 4021 bus. The tick count is now cleared every time a serial receive nterrupt fires.

Discussions