File tree Expand file tree Collapse file tree 4 files changed +56
-0
lines changed
examples/arduino-nano-every Expand file tree Collapse file tree 4 files changed +56
-0
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ members = [
29
29
" examples/arduino-mega2560" ,
30
30
" examples/arduino-mega1280" ,
31
31
" examples/arduino-nano" ,
32
+ " examples/arduino-nano-every" ,
32
33
" examples/arduino-uno" ,
33
34
" examples/atmega2560" ,
34
35
" examples/nano168" ,
Original file line number Diff line number Diff line change
1
+ [build ]
2
+ target = " ../../avr-specs/avr-atmega4809.json"
3
+
4
+ [unstable ]
5
+ build-std = [" core" ]
Original file line number Diff line number Diff line change
1
+ [package ]
2
+ name = " arduino-nano-every-examples"
3
+ version = " 0.0.0"
4
+ authors = [
" Rahix <[email protected] >" ]
5
+ edition = " 2018"
6
+ publish = false
7
+
8
+ [dependencies ]
9
+ panic-halt = " 0.2.0"
10
+ ufmt = " 0.1.0"
11
+ nb = " 0.1.2"
12
+ embedded-hal = " 0.2.3"
13
+
14
+ [dependencies .atxmega-hal ]
15
+ path = " ../../mcu/atxmega-hal/"
16
+ features = [" atmega4809" , " rt" ]
Original file line number Diff line number Diff line change
1
+ #![ no_std]
2
+ #![ no_main]
3
+
4
+ // Proof of concept, all hacked together right now...
5
+ //
6
+ // Compile with the dirty avr-atmega4809.json target (which actually uses atxmega32a4 ...).
7
+ //
8
+ // Flashing works using the following command, based on the Arduino stuff (not verified anything
9
+ // else yet):
10
+ //
11
+ // stty -F /dev/ttyACM0 hup 1200 && \
12
+ // echo 1>/dev/ttyACM0 && \
13
+ // ~/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/bin/avrdude \
14
+ // -C${HOME}/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf \
15
+ // -v -patmega4809 -cjtag2updi -P/dev/ttyACM0 -b115200 -e -D \
16
+ // -Uflash:w:../../target/avr-atmega4809/release/every-blink.elf:e
17
+
18
+ use panic_halt as _;
19
+
20
+ use embedded_hal:: blocking:: delay:: DelayMs ;
21
+
22
+ #[ atxmega_hal:: entry]
23
+ fn main ( ) -> ! {
24
+ let dp = atxmega_hal:: Peripherals :: take ( ) . unwrap ( ) ;
25
+
26
+ let mut led = dp. pins . pe2 . into_output ( ) ;
27
+
28
+ let mut delay = atxmega_hal:: delay:: Delay :: < atxmega_hal:: clock:: MHz16 > :: new ( ) ;
29
+
30
+ loop {
31
+ led. toggle ( ) ;
32
+ delay. delay_ms ( 100u16 ) ;
33
+ }
34
+ }
You can’t perform that action at this time.
0 commit comments