diff options
author | inmarket <andrewh@inmarket.com.au> | 2013-06-02 18:59:12 +1000 |
---|---|---|
committer | inmarket <andrewh@inmarket.com.au> | 2013-06-02 18:59:12 +1000 |
commit | 8a5596b39d44d7fe1fbb359cd436fe23cde97339 (patch) | |
tree | 7f29b431f4a3c25d2688b8e1d8aec16fa0975c82 /demos/3rdparty/notepad-2/main.c | |
parent | e9f60dae385f1c7b58d1ae26a00d051da40f65d3 (diff) | |
download | uGFX-8a5596b39d44d7fe1fbb359cd436fe23cde97339.tar.gz uGFX-8a5596b39d44d7fe1fbb359cd436fe23cde97339.tar.bz2 uGFX-8a5596b39d44d7fe1fbb359cd436fe23cde97339.zip |
Notepad-2 demo updated to work on ChibiOS or pure Win32 compile
Diffstat (limited to 'demos/3rdparty/notepad-2/main.c')
-rw-r--r-- | demos/3rdparty/notepad-2/main.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/demos/3rdparty/notepad-2/main.c b/demos/3rdparty/notepad-2/main.c index bd79d574..e4649146 100644 --- a/demos/3rdparty/notepad-2/main.c +++ b/demos/3rdparty/notepad-2/main.c @@ -28,10 +28,10 @@ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Modified by InMarket to allow it to compile on any GFX supported operating system. */ -#include "ch.h" -#include "hal.h" #include "gfx.h" #include "notepadApp.h" @@ -69,6 +69,7 @@ const NColorScheme schemeDefault2 = { const char *tsCalibRead(uint16_t instance) { // This will perform a on-spot calibration // Unless you read and add the co-efficients here + (void) instance; return NULL; } @@ -77,12 +78,7 @@ int main(void) { font_t font = gdispOpenFont("UI2"); /* initialize the hardware and the OS */ - halInit(); - chSysInit(); - - /* initialize the LCD */ gfxInit(); - gdispClear(Black); /* Calibrate the touchscreen */ ginputSetMouseCalibrationRoutines(0, NULL, tsCalibRead, FALSE); @@ -92,16 +88,14 @@ int main(void) { nSetColorScheme(schemeDefault); while (TRUE) { + gfxThreadWait(nLaunchNotepadApp()); - chThdWait(nLaunchNotepadApp()); - - gdispClear(Black); gdispSetClip(0, 0, gdispGetWidth(), gdispGetHeight()); + gdispClear(Black); gdispDrawString(3, 3, "Notepad Terminated.", font, White); gdispDrawString(3, 20, "Relaunching Notepad App...", font, White); - chThdSleepMilliseconds(1000); - + gfxSleepMilliseconds(1000); } return 0; |