X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=examples%2Flm3s1968%2Fhw%2Fhw_rit128x96.h;h=32edf8ee0af8b64db9e341b7cca4fa1b5498c23e;hb=06f6a1afc7157d25c3dae42af3478e4f0b31a2af;hp=495c2e564a260f3d6883f22e26ae63b0555346c5;hpb=7ded58114194b75f629e0ddfafafc44083cad17c;p=bertos.git diff --git a/examples/lm3s1968/hw/hw_rit128x96.h b/examples/lm3s1968/hw/hw_rit128x96.h index 495c2e56..32edf8ee 100644 --- a/examples/lm3s1968/hw/hw_rit128x96.h +++ b/examples/lm3s1968/hw/hw_rit128x96.h @@ -73,24 +73,19 @@ 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) { - 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,12 @@ INLINE void lcd_bus_init(void) /* Drain the SSI RX FIFO */ while (lm3s_ssiReadFrameNonBlocking(SSI0_BASE, &dummy)); - - IRQ_RESTORE(flags); } +/* + * XXX: menu stuff requires lcd_blitBimap() function to be defined. + * Find a better way to do this. + */ +#define rit128x96_lcd_blitBitmap lcd_blitBitmap + #endif /* HW_RIT128x96_H */