Skip to content

Commit

Permalink
Getting rid of intermediate *.c and *.h files.
Browse files Browse the repository at this point in the history
  • Loading branch information
buzden committed May 12, 2020
1 parent 8fedf28 commit d25bb68
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 23 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*.ibc
*.o
/build-*
/[A-Z]*.c
8 changes: 4 additions & 4 deletions Blink.idr
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
module Main

%include C "idris_arduino.h"
%include C "Arduino.h"

digitalWrite : Int -> Int -> IO ()
digitalWrite pin val = foreign FFI_C "idrard_digitalWrite" (Int -> Int -> IO ()) pin val
digitalWrite pin val = foreign FFI_C "digitalWrite" (Int -> Int -> IO ()) pin val

pinMode : Int -> Int -> IO ()
pinMode pin mode = foreign FFI_C "idrard_pinMode" (Int -> Int -> IO ()) pin mode
pinMode pin mode = foreign FFI_C "pinMode" (Int -> Int -> IO ()) pin mode

delay : Int -> IO ()
delay ms = foreign FFI_C "idrard_delay" (Int -> IO ()) ms
delay ms = foreign FFI_C "delay" (Int -> IO ()) ms

blink : Int -> Int -> IO ()
blink pin t = do digitalWrite pin 1
Expand Down
3 changes: 2 additions & 1 deletion Idris.mk
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ RTS_OBJS = \
$(OBJDIR)/rts/idris_heap.o \
$(OBJDIR)/rts/mini-gmp.o

OTHER_OBJS += $(RTS_OBJS) $(IDRIS_MAIN:.idr=.o)
LOCAL_C_SRCS += $(IDRIS_MAIN:.idr=.c)
OTHER_OBJS += $(RTS_OBJS)

include $(ARDUINO_MAKEFILE_PATH)

Expand Down
15 changes: 0 additions & 15 deletions idris_arduino.c

This file was deleted.

3 changes: 0 additions & 3 deletions idris_arduino.h

This file was deleted.

0 comments on commit d25bb68

Please sign in to comment.