X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=examples%2Flm3s1968%2Fhw%2Fhw_rit128x96.h;h=6e1c933c9f261440af80d75fd2c0c604965c5721;hb=0797fa39b4027e4da1883be805405ba2de4df111;hp=495c2e564a260f3d6883f22e26ae63b0555346c5;hpb=82aa9864bc5accc468d3c9ed109a8b44ef36da94;p=bertos.git diff --git a/examples/lm3s1968/hw/hw_rit128x96.h b/examples/lm3s1968/hw/hw_rit128x96.h index 495c2e56..6e1c933c 100644 --- a/examples/lm3s1968/hw/hw_rit128x96.h +++ b/examples/lm3s1968/hw/hw_rit128x96.h @@ -73,24 +73,20 @@ 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; \ + lm3s_ssiWriteFrame(SSI0_BASE, x); \ + /* Dummy read to drain the FIFO */ \ + while (!lm3s_ssiReadFrameNonBlocking(SSI0_BASE, &_x)); \ + cpu_relax(); \ + } /*@}*/ INLINE void lcd_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 +118,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 */