Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of RA8875 by
Diff: RA8875.cpp
- Revision:
- 142:6e9bff59878a
- Parent:
- 141:2ec78a50dc98
- Child:
- 143:e872d65a710d
--- a/RA8875.cpp Thu Dec 29 20:06:00 2016 +0000 +++ b/RA8875.cpp Sun Mar 19 21:41:24 2017 +0000 @@ -281,17 +281,19 @@ } -RetCode_t RA8875::SelectDrawingLayer(uint16_t layer) +uint16_t RA8875::SelectDrawingLayer(uint16_t layer) { - unsigned char mwcr1 = ReadCommand(0x41) & ~0x01; // retain all but the currently selected layer - + unsigned char mwcr1 = ReadCommand(0x41); // retain all but the currently selected layer + uint16_t prevlayer = mwcr1 & 1; + + mwcr1 &= ~0x01; // remove the current layer if (screenwidth >= 800 && screenheight >= 480 && screenbpp > 8) { - return bad_parameter; + layer = 0; } else if (layer > 1) { - return bad_parameter; - } else { // layer == 0 ro 1 - return WriteCommand(0x41, mwcr1 | layer); + layer = 0; } + WriteCommand(0x41, mwcr1 | layer); + return prevlayer; } @@ -1193,7 +1195,7 @@ SelectDrawingLayer(1); clsw(FULLWINDOW); } - ret = SelectDrawingLayer(prevLayer); + SelectDrawingLayer(prevLayer); } ret = SetTextCursor(0,0); ret = locate(0,0);