1st Fork

Dependencies:   mbed QEI DmTftLibrary

Revision:
17:a0bbfc228415
Parent:
0:9c0917bfde97
diff -r 4a05c050f5e0 -r a0bbfc228415 Display/DisplayDriver.cpp
--- a/Display/DisplayDriver.cpp	Tue Aug 22 13:26:29 2017 +0000
+++ b/Display/DisplayDriver.cpp	Wed Jul 18 08:51:53 2018 +0000
@@ -131,7 +131,14 @@
     {
         return GO_STATUS_BAD_ARG;
     }
-
+    if( goObject->Xpos + goObject->Width > SCREEN_WIDTH )
+    {
+        return GO_STATUS_BAD_COORD;
+    }
+    if( goObject->Ypos + goObject->Height > SCREEN_HEIGHT )
+    {
+        return GO_STATUS_BAD_COORD;
+    }
     switch( goObject->Type )
     {
         case GO_TEXT:
@@ -245,7 +252,14 @@
     {
         return GO_STATUS_BAD_ARG;
     }
-
+    if( goObject->Xpos + goObject->Width > SCREEN_WIDTH )
+    {
+        return GO_STATUS_BAD_COORD;
+    }
+    if( goObject->Ypos + goObject->Height > SCREEN_HEIGHT )
+    {
+        return GO_STATUS_BAD_COORD;
+    }
     switch( goObject->Type )
     {
         case GO_TEXT:
@@ -329,8 +343,6 @@
     bool touched = false;
     GraphObjectStatus_t status = GO_STATUS_BAD_COORD;
 
-    __disable_irq( );    // Disable Interrupts
-
     if( Touch.isTouched( ) )
     {
         Touch.readTouchData( x, y, touched );
@@ -355,8 +367,6 @@
         }
     }
 
-    __enable_irq( );     // Enable Interrupts
-
     return status;
 }