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_TFT_ILI9341 TFT_fonts mbed
Fork of Mandelbrot by
Revision 3:267e7130007d, committed 2015-01-22
- Comitter:
- gregeric
- Date:
- Thu Jan 22 10:01:49 2015 +0000
- Parent:
- 2:b1169b84a563
- Commit message:
- Increase debounce time, shown necessary after round of testing.
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Tue Jan 20 15:10:25 2015 +0000
+++ b/main.cpp Thu Jan 22 10:01:49 2015 +0000
@@ -56,7 +56,7 @@
#define maxiters (MINITERS+TIM4->CNT)
uint16_t lastiters=MINITERS;
-enum nextaction {
+enum nextaction_t {
idle=0,
zoomin,
zoomout,
@@ -64,7 +64,7 @@
interrupted
};
-enum nextaction buttonpressed;
+nextaction_t buttonpressed;
void GotZoomIn(void)
{
@@ -302,7 +302,7 @@
//log status @ PC serial port
printf("%1.18f%+1.18fi, %+d, %d\n\r", centrex, -centrey, log2zoom, maxiters);
- wait(0.2); //debounce
+ wait(0.3); //debounce
buttonpressed=idle;
UpdateStats();
@@ -311,7 +311,7 @@
tt.set_orientation(ORIENTATION);
DrawMandelbrot();
- wait(0.2); //debounce
+ wait(0.3); //debounce
//flag that we should update status bar, but not commence new render
if (buttonpressed) buttonpressed=interrupted;
@@ -331,8 +331,10 @@
if (shiftx!=lastshiftx || shifty!=lastshifty || maxiters!=lastiters) break;
}
- EraseCursor(WIDTH/2+lastshiftx, HEIGHT/2+lastshifty);
- DrawCursor(WIDTH/2+shiftx, HEIGHT/2+shifty);
+ if(maxiters==lastiters) { //we're here cos cursor moved (speeds up redraw when twiddling maxiter knob
+ EraseCursor(WIDTH/2+lastshiftx, HEIGHT/2+lastshifty);
+ DrawCursor(WIDTH/2+shiftx, HEIGHT/2+shifty);
+ }
lastshiftx=shiftx;
lastshifty=shifty;
