Dual CANbus monitor and instrumentation cluster supporting ILI9341 display controller

Dependencies:   SPI_TFTx2_ILI9341 TOUCH_TFTx2_ILI9341 TFT_fonts mbed

Fork of CANary by Tick Tock

Revision:
22:a43df3905863
Parent:
20:3bf176d14b14
Child:
23:cd03f9c3395e
--- a/utility.cpp	Fri Mar 08 04:43:24 2013 +0000
+++ b/utility.cpp	Mon Mar 11 06:23:00 2013 +0000
@@ -3,6 +3,7 @@
 #include "utility.h"
 
 void mbed_reset();
+
 void RTC_IRQHandler() {
     timer.reset(); // zero ms at the-seconds-tic
     canIdle=(++secsNoMsg>canTimeout)?true:false;
@@ -25,8 +26,7 @@
 
 void touch_ISR(){
     LPC_GPIOINT->IO2IntClr = (LPC_GPIOINT->IO2IntStatR | LPC_GPIOINT->IO2IntStatF);
-    secsNoTouch = 0;
-    touched=true;
+    touched=true; // jsut set flag - touch screen algorythm is long and we don't want to block other interrupts
 }
 
 unsigned short getTimeStamp() {
@@ -175,3 +175,12 @@
     led2 = !led2;
 }
 
+unsigned char buttonX(unsigned short X, unsigned char columns) {
+    unsigned char val = X*columns/320;
+    return val;
+}
+
+unsigned char buttonY(unsigned short Y, unsigned char rows) {
+    unsigned short val = Y*rows/240;
+    return val;
+}