diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-11-09 22:37:52 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-11-09 22:37:52 +0000 |
commit | 1ac3cb8a10935e866f6edc6eb294a1f1a33c5e74 (patch) | |
tree | 0b6bd4900f94f1c05bdac8acc492c4197ae925f3 /nuttx/drivers/lcd | |
parent | 332cf8e16d4b3ade203b6f886c152a25c1972591 (diff) | |
download | px4-nuttx-1ac3cb8a10935e866f6edc6eb294a1f1a33c5e74.tar.gz px4-nuttx-1ac3cb8a10935e866f6edc6eb294a1f1a33c5e74.tar.bz2 px4-nuttx-1ac3cb8a10935e866f6edc6eb294a1f1a33c5e74.zip |
Misc changes to accept setenv.bat; Add UG-2864AMBAG01 reverse landscape support
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5326 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/drivers/lcd')
-rw-r--r-- | nuttx/drivers/lcd/ug-2864ambag01.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/nuttx/drivers/lcd/ug-2864ambag01.c b/nuttx/drivers/lcd/ug-2864ambag01.c index aa50abaed..e133f3901 100644 --- a/nuttx/drivers/lcd/ug-2864ambag01.c +++ b/nuttx/drivers/lcd/ug-2864ambag01.c @@ -153,6 +153,8 @@ # undef CONFIG_LCD_PORTRAIT # undef CONFIG_LCD_RLANDSCAPE # undef CONFIG_LCD_RPORTRAIT +#elif defined(CONFIG_LCD_RLANDSCAPE) +# warning "Reverse landscape mode is untested and, hence, probably buggy" #endif /* SH1101A Commands *******************************************************************/ @@ -574,7 +576,11 @@ static int ug2864ambag01_putrun(fb_coord_t row, fb_coord_t col, FAR const uint8_ fbmask = 1 << (row & 7); fbptr = &priv->fb[page * UG2864AMBAG01_XRES + col]; +#ifdef CONFIG_LCD_RLANDSCAPE + ptr = fbptr + pixlen - 1; +#else ptr = fbptr; +#endif #ifdef CONFIG_NX_PACKEDMSFIRST usrmask = MS_BIT; #else @@ -585,6 +591,16 @@ static int ug2864ambag01_putrun(fb_coord_t row, fb_coord_t col, FAR const uint8_ { /* Set or clear the corresponding bit */ +#ifdef CONFIG_LCD_RLANDSCAPE + if ((*buffer & usrmask) != 0) + { + *ptr-- |= fbmask; + } + else + { + *ptr-- &= ~fbmask; + } +#else if ((*buffer & usrmask) != 0) { *ptr++ |= fbmask; @@ -593,6 +609,7 @@ static int ug2864ambag01_putrun(fb_coord_t row, fb_coord_t col, FAR const uint8_ { *ptr++ &= ~fbmask; } +#endif /* Inc/Decrement to the next source pixel */ @@ -748,7 +765,11 @@ static int ug2864ambag01_getrun(fb_coord_t row, fb_coord_t col, FAR uint8_t *buf */ fbmask = 1 << (row & 7); +#ifdef CONFIG_LCD_RLANDSCAPE + fbptr = &priv->fb[page * (UG2864AMBAG01_XRES-1) + col + pixlen]; +#else fbptr = &priv->fb[page * UG2864AMBAG01_XRES + col]; +#endif #ifdef CONFIG_NX_PACKEDMSFIRST usrmask = MS_BIT; #else @@ -760,7 +781,11 @@ static int ug2864ambag01_getrun(fb_coord_t row, fb_coord_t col, FAR uint8_t *buf { /* Set or clear the corresponding bit */ +#ifdef CONFIG_LCD_RLANDSCAPE + uint8_t byte = *fbptr--; +#else uint8_t byte = *fbptr++; +#endif if ((byte & fbmask) != 0) { *buffer |= usrmask; |