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.
Dependencies: SPI_TFTx2 TFT_fonts TOUCH_TFTx2 mbed
Fork of CANary by
Diff: utility.cpp
- 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;
+}
