From 8fba47b7d8692acb150238064e0554cd476b58ee Mon Sep 17 00:00:00 2001 From: Jared Boone Date: Thu, 7 Jan 2016 10:53:27 -0800 Subject: [PATCH] FIFO in and out indices should be volatile. Later code revealed that the receiving core never notices (reads anew) the _in member variable when waiting for the FIFO to be empty (_in == _out). --- firmware/common/fifo.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/firmware/common/fifo.hpp b/firmware/common/fifo.hpp index 83ee06de..66c9c811 100644 --- a/firmware/common/fifo.hpp +++ b/firmware/common/fifo.hpp @@ -201,8 +201,8 @@ private: } T _data[size()]; - size_t _in; - size_t _out; + volatile size_t _in; + volatile size_t _out; }; #endif/*__FIFO_H__*/