-#define LCD_WRITE(x) lm3s_ssiWriteFrame(SSI0_BASE, x)
-
-/* Read data from the display */
-#define LCD_READ \
- ({ \
- uint32_t frame; \
- lm3s_ssiReadFrame(SSI0_BASE, &frame); \
- frame; \
- })
+#define LCD_WRITE(x) \
+ { \
+ uint32_t _x; \
+ while (!lm3s_ssiWriteFrameNonBlocking(SSI0_BASE, x)); \
+ /* Dummy read to drain the FIFO */ \
+ while (!lm3s_ssiReadFrameNonBlocking(SSI0_BASE, &_x)); \
+ }