diff --git a/Blink.idr b/Blink.idr index 20b890f..8a9870c 100644 --- a/Blink.idr +++ b/Blink.idr @@ -12,7 +12,11 @@ delay : Int -> IO () delay ms = foreign FFI_C "idrard_delay" (Int -> IO ()) ms blink : Int -> Int -> IO () -blink pin ms = foreign FFI_C "idrard_blink" (Int -> Int -> IO ()) pin ms +blink pin t = do digitalWrite pin 1 + delay t + digitalWrite pin 0 + delay t + blink pin t main : IO () main = diff --git a/idris_arduino.c b/idris_arduino.c index 331ecf7..7b0fb31 100644 --- a/idris_arduino.c +++ b/idris_arduino.c @@ -13,14 +13,3 @@ void idrard_pinMode(int pin, int mode) void idrard_delay(int ms) { delay(ms); } - -void idrard_blink(int pin, int ms) { -// pinMode(pin, OUTPUT); - while(1) { - digitalWrite(pin, 1); - delay(ms); - digitalWrite(pin, 0); - delay(ms); - } -} - diff --git a/idris_arduino.h b/idris_arduino.h index 39e676f..f76c72d 100644 --- a/idris_arduino.h +++ b/idris_arduino.h @@ -1,4 +1,3 @@ void idrard_digitalWrite(int pin, int val); void idrard_pinMode(int pin, int mode); void idrard_delay(int ms); -void idrard_blink(int pin, int ms);