-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcondComp.txt
44 lines (36 loc) · 900 Bytes
/
condComp.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
\ *********************************************************************
\ Conditional compilation
\ Filename: condComp.txt
\ Date: 16/06/2020
\ Updated: 16/06/2020
\ File Version: 1.0
\ MCU: ARDUINO all models
\ Copyright: Marc PETREMANN
\ Author: Marc PETREMANN
\ GNU General Public License
\ *********************************************************************
\ the word ?\ is a conditionnal comment. Usage:
\ true ?\ 2 3 + .
\ false ?\ 4 5 + .
: ?\ ( fl --- )
0=
if
postpone \
then
; immediate
\ Practical example for ARDUINO:
-blink
marker -blink
true constant NANO
false constant MEGA
\ require pinsDefinitions.txt
37 constant PORTB
flash
MEGA ?\ PORTB %10000000 defPIN: LED ( PB7 pin 13 )
NANO ?\ PORTB %00100000 defPIN: LED ( PB5 pin 13 )
ram
\ in interpet mode:
LED output
LED high
1000 ms
LED low