Update examples.
[bertos.git] / examples / lm3s1968 / hw / hw_rit128x96.h
index 495c2e564a260f3d6883f22e26ae63b0555346c5..5a8de9fc250bc082da5ce28c68c8276cda7e3987 100644 (file)
        lm3s_gpioPinWrite(GPIO_PORTH_BASE, GPIO_OLEDDC_PIN, GPIO_OLEDDC_PIN)
 
 /* Send data to the display */
-#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));  \
+       }
 /*@}*/
 
-INLINE void lcd_bus_init(void)
+INLINE void lcd_rit128x96_hw_bus_init(void)
 {
-       cpu_flags_t flags;
        uint32_t dummy;
 
-       IRQ_SAVE_DISABLE(flags);
-
        /* Enable the peripheral clock */
        SYSCTL_RCGC1_R |= SYSCTL_RCGC1_SSI0;
        SYSCTL_RCGC2_R |= SYSCTL_RCGC2_GPIOA;
@@ -122,8 +117,6 @@ INLINE void lcd_bus_init(void)
 
        /* Drain the SSI RX FIFO */
        while (lm3s_ssiReadFrameNonBlocking(SSI0_BASE, &dummy));
-
-       IRQ_RESTORE(flags);
 }
 
 #endif /* HW_RIT128x96_H */