From fb6e2fed7132ae776c62aecc2ee09ad532d482d3 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 16 Jan 2022 18:36:36 +0100 Subject: msp430fr: use 16-byte uart input buffer --- include/arch/msp430fr5994lp/driver/stdin.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'include/arch/msp430fr5994lp/driver') diff --git a/include/arch/msp430fr5994lp/driver/stdin.h b/include/arch/msp430fr5994lp/driver/stdin.h index 1085111..7b78a9a 100644 --- a/include/arch/msp430fr5994lp/driver/stdin.h +++ b/include/arch/msp430fr5994lp/driver/stdin.h @@ -9,8 +9,10 @@ class StandardInput { private: StandardInput(const StandardInput ©); - char buffer[8]; - unsigned char write_pos, read_pos; + static unsigned char const bufsize = 16; + char buffer[bufsize]; + volatile unsigned char write_pos; + unsigned char read_pos; public: StandardInput() : write_pos(0), read_pos(0) {} @@ -20,7 +22,7 @@ class StandardInput { inline void addKey(char key) { buffer[write_pos++] = key; - write_pos %= 8; + write_pos %= bufsize; } }; -- cgit v1.2.3