summaryrefslogtreecommitdiffstats
path: root/Graphic_Equalizer/src
diff options
context:
space:
mode:
authorOliver Schinagl <oliver@schinagl.nl>2004-10-21 09:33:39 (GMT)
committerOliver Schinagl <oliver@schinagl.nl>2004-10-21 09:33:39 (GMT)
commita651ae0a1d303f92043624dec87314e369bf2bca (patch)
treed1ed062d0b3ce716499ffb163a04253ecd5cda6d /Graphic_Equalizer/src
parentaf5a259129437cd0ed97186cf7a12e8be17767ec (diff)
downloadTASS-a651ae0a1d303f92043624dec87314e369bf2bca.zip
TASS-a651ae0a1d303f92043624dec87314e369bf2bca.tar.gz
TASS-a651ae0a1d303f92043624dec87314e369bf2bca.tar.bz2
Diffstat (limited to 'Graphic_Equalizer/src')
-rw-r--r--Graphic_Equalizer/src/display/display.hcc44
-rw-r--r--Graphic_Equalizer/src/display/main.hcc13
-rw-r--r--Graphic_Equalizer/src/display/mousedriver.hcc15
3 files changed, 43 insertions, 29 deletions
diff --git a/Graphic_Equalizer/src/display/display.hcc b/Graphic_Equalizer/src/display/display.hcc
index 48dd78c..0440ffe 100644
--- a/Graphic_Equalizer/src/display/display.hcc
+++ b/Graphic_Equalizer/src/display/display.hcc
@@ -26,31 +26,45 @@
-/*! \fn void display_main(VideoOut);
+/*! \fn void display_main(void);
* \brief This routine handles all drawing of pixels. It never returns!
*
- * \param VideoOut this function takes the VideoOut macro pointer
- * PalVideoOutOptimalCT(ClockRate). For efficiency
- * reasons it is passed along however.
+ * \param void None.
*
- * \return void
+ * \return Never Returns.
* \retval void
*/
-static macro proc display_main(VideoOut) {
- unsigned 24 Pixel;
+void display_main(void) {
+ /* Set VideoOut Pointer */
+ macro expr VideoOut = PalVideoOutOptimalCT(ClockRate);
+
+ unsigned 24 pixel;
+ unsigned 20 pixels;
+#if 0
+ unsigned 8 r, g, b;
+#endif
/*
* These macro's are used to efficiently get the current X ScanLine
* and Y ScanLine.
*/
- macro expr ScanX = PalVideoOutGetX (VideoOut);
- macro expr ScanY = PalVideoOutGetY (VideoOut);
-
- for (Pixel = 0;; Pixel += 26214) {
- if (ScanX < 641) {
- PalVideoOutWrite(VideoOut, Pixel);
- } else {
- Pixel = 0;
+ macro expr ScanX = PalVideoOutGetX(VideoOut);
+ macro expr ScanY = PalVideoOutGetY(VideoOut);
+
+#if 0
+ r = 0;
+ g = 0;
+ b = 0;
+ pixel = r @ g @ b;
+#endif
+ for (pixels = 1;; pixels++) {
+ /*
+ * If we wrote to all pixels we change the color.
+ */
+ if ((640 * 480) == pixels) {
+ pixels = 0;
+ pixel++;
}
+ PalVideoOutWrite(VideoOut, pixel);
}
} /* --- display_main() --- */
diff --git a/Graphic_Equalizer/src/display/main.hcc b/Graphic_Equalizer/src/display/main.hcc
index 3db26bb..d389008 100644
--- a/Graphic_Equalizer/src/display/main.hcc
+++ b/Graphic_Equalizer/src/display/main.hcc
@@ -16,7 +16,6 @@
*
*****************************************************************************/
-/******** Application Defines *********/
/*
* Set the Clock rate for this domain. 25.175 Mhz is required for the TFT.
@@ -39,9 +38,8 @@
static macro expr ClockRate = PAL_ACTUAL_CLOCK_RATE;
-
/*! \fn void main(void);
- * \brief
+ * \brief Main User Input/Ouput loop.
*
* \param void
*
@@ -54,6 +52,7 @@ void main(void) {
/*
* Check library versions and Request VideoOutput.
+ * We need at least Major Version 1. Minor version 0 suffices.
*/
PalVersionRequire(1, 0);
PalVideoOutRequire(1);
@@ -63,12 +62,12 @@ void main(void) {
*/
par {
/*
- * Primary task is to 'Run' several hardware
+ * Primary task is to 'Run' several hardware simultaniously.
* VideoOutput needs to be in sync with the touchscreen and
* need to run in sync.
*/
- display_run(VideoOut, ClockRate);
- mouse_run(ClockRate);
+ PalVideoOutRun(VideoOut, ClockRate);
+ MouseRun(ClockRate);
/* Parallel to our Primary tasks we run the application. */
seq {
@@ -80,7 +79,7 @@ void main(void) {
* display parallel.
*/
mouse_main();
- display_main(VideoOut);
+ display_main();
}
}
}
diff --git a/Graphic_Equalizer/src/display/mousedriver.hcc b/Graphic_Equalizer/src/display/mousedriver.hcc
index 682e2b0..6f69129 100644
--- a/Graphic_Equalizer/src/display/mousedriver.hcc
+++ b/Graphic_Equalizer/src/display/mousedriver.hcc
@@ -32,7 +32,7 @@
* Mouse data is stored in shared memory. When new mouse data is available
* Mouse notification is triggerd.
*/
-struct mousedata_s mousedata;
+mousedata_s mousedata;
chan unsigned 1 mousedata_notification;
/*! \fn void mouse_main(void);
@@ -40,16 +40,17 @@ chan unsigned 1 mousedata_notification;
* main mousehandler and returns the States and coordinates
* into the shared mpram.
*
- * \param void
+ * \param void None.
*
- * \return void
+ * \return Never Returns.
* \retval void
*/
-void mouse_main(void) {
+void mouse_main(void)
+{
unsigned 14 touch_sampler;
- unsigned 10 x, oldy;
- unsigned 9 y, oldx;
- unsigned 3 mouse_state, oldmousestate;
+ unsigned 10 x, oldx;
+ unsigned 9 y, oldy;
+ unsigned 3 mousestate, oldmousestate;
unsigned 1 touch, touched, oldtouched;
/*