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
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.