From 11a0da5c63faffd45bde43da2777a9771cfdf5e9 Mon Sep 17 00:00:00 2001 From: Marti Bolivar Date: Mon, 2 May 2011 14:33:05 -0400 Subject: /examples/ cleanups. --- examples/vga-scope.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'examples/vga-scope.cpp') diff --git a/examples/vga-scope.cpp b/examples/vga-scope.cpp index 66e72e9..9aa8bcb 100644 --- a/examples/vga-scope.cpp +++ b/examples/vga-scope.cpp @@ -40,7 +40,6 @@ // FIXME: generalize for Native and Mini -#define LED_PIN BOARD_LED_PIN #define ANALOG_PIN 18 // Pinouts -- you also must change the GPIO macros below if you change @@ -90,9 +89,9 @@ void isr_stop(void); void isr_update(void); void setup() { - pinMode(LED_PIN, OUTPUT); + pinMode(BOARD_LED_PIN, OUTPUT); pinMode(ANALOG_PIN, INPUT_ANALOG); - digitalWrite(LED_PIN, 1); + digitalWrite(BOARD_LED_PIN, 1); pinMode(VGA_R, OUTPUT); pinMode(VGA_G, OUTPUT); pinMode(VGA_B, OUTPUT); @@ -138,26 +137,26 @@ void setup() { uint16 y = 0; uint16 val = 0; bool v_active = true; -const uint16 x_max = 60; // empirically (and lazily) determined +const uint16 x_max = 60; // empirically (and sloppily) determined void isr_porch(void) { VGA_H_HIGH; y++; val = map(analogRead(ANALOG_PIN), 0, 4095, 0, x_max); - if(y >= 523) { + if (y >= 523) { y = 1; v_active = true; return; } - if(y >= 492) { + if (y >= 492) { VGA_V_HIGH; return; } - if(y >= 490) { + if (y >= 490) { VGA_V_LOW; return; } - if(y >= 479) { + if (y >= 479) { v_active = false; return; } @@ -199,7 +198,7 @@ __attribute__((constructor)) void premain() { int main(void) { setup(); - while (1) { + while (true) { loop(); } return 0; -- cgit v1.2.3