let a4 = pins.a4.into_pull_up_input(&mut pins.ddr);
let a5 = pins.a5.into_pull_up_input(&mut pins.ddr);
let i2c = I2cMaster::new(
dp.TWI,
a4,
a5,
57600
);
let addr = SlaveAddr::default();
let mut sensor = Mlx9061x::new_mlx90614(i2c, addr, 5).unwrap();
loop {
let temp = sensor.object1_temperature().unwrap();
println!("Object temperature: {}ΒΊC", temp);
...
}
[profile.dev]
...
lto = true
overflow-checks = false
...
boards
folder is not used anymore at all
arduino-hal
crate which has feature flags for each boards - you need to add arduino-nano
there...
examples/
with examples for each board. I am not sure if it makes sense to add separate examples for nano though, or if it is a better idea to just refer to the uno examples for them
uno-adc.rs
example to my Nano and it appears to be working fine
arduino-uno
crate with its nano support. I should have taken a closer look before sending you off with this! Now, I think the following would be a good plan:arduino-nano
feature flag to arduino-hal
.arduino-uno
with just a blink and ADC example. I think for the rest we should just refer people to Arduino Uno, but it would be nice to a) have a blink example which you can just cargo run
with zero setup, and b) show how the additional ADC pins can be used.Carls-MacBook-Pro:src carlpeto$ "/Applications/Swift For Arduino.app/Contents/XPCServices/S4ABuildEngine.xpc/Contents/Resources/llvm-avr/llc" -O3 -march=avr -mcpu=atmega4809 -filetype=obj -function-sections -o ../build/atmega4809/register_PORTE.DIR.swft.o ../build/atmega4809/register_PORTE.DIR.swft.ll
'atmega4809' is not a recognized processor for this target (ignoring processor)
'atmega4809' is not a recognized processor for this target (ignoring processor)
'atmega4809' is not a recognized processor for this target (ignoring processor)
'atmega4809' is not a recognized processor for this target (ignoring processor)
'atmega4809' is not a recognized processor for this target (ignoring processor)
'atmega4809' is not a recognized processor for this target (ignoring processor)
'atmega4809' is not a recognized processor for this target (ignoring processor)
'atmega4809' is not a recognized processor for this target (ignoring processor)
'atmega4809' is not a recognized processor for this target (ignoring processor)
'atmega4809' is not a recognized processor for this target (ignoring processor)
Carls-MacBook-Pro:src carlpeto$ "/Applications/Swift For Arduino.app/Contents/XPCServices/S4ABuildEngine.xpc/Contents/Resources/llvm-avr/llc" -O3 -march=avr -mcpu=atxmega3 -filetype=obj -function-sections -o ../build/atmega4809/register_PORTE.DIR.swft.o ../build/atmega4809/register_PORTE.DIR.swft.ll
'atxmega3' is not a recognized processor for this target (ignoring processor)
'atxmega3' is not a recognized processor for this target (ignoring processor)
'atxmega3' is not a recognized processor for this target (ignoring processor)
'atxmega3' is not a recognized processor for this target (ignoring processor)
'atxmega3' is not a recognized processor for this target (ignoring processor)
'atxmega3' is not a recognized processor for this target (ignoring processor)
'atxmega3' is not a recognized processor for this target (ignoring processor)
'atxmega3' is not a recognized processor for this target (ignoring processor)
'atxmega3' is not a recognized processor for this target (ignoring processor)
'atxmega3' is not a recognized processor for this target (ignoring processor)
Carls-MacBook-Pro:src carlpeto$ "/Applications/Swift For Arduino.app/Contents/XPCServices/S4ABuildEngine.xpc/Contents/Resources/llvm-avr/llc" -O3 -march=avr -mcpu=avrxmega3 -filetype=obj -function-sections -o ../build/atmega4809/register_PORTE.DIR.swft.o ../build/atmega4809/register_PORTE.DIR.swft.ll
Carls-MacBook-Pro:src carlpeto$
Hello! π
I just tried setting up a project for an attiny13, edited the target json file so cpu and mmcu = avr25
, but getting this when I run cargo build -Z build-std=core
:
Compiling rustc-std-workspace-core v1.99.0 (/home/glindstedt/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/rustc-std-workspace-core)
error: ran out of registers during register allocation
Anyone else run into this?
--release
LLVM ERROR: Not supported instr: <MCInst 296 <MCOperand Reg:1> <MCOperand Imm:15> <MCOperand Reg:43>>
:point_up: Edit: Hello! π
I just tried setting up a project for an attiny13, edited the target json file so cpu and mmcu = attiny13
, but getting this when I run cargo build -Z build-std=core
:
Compiling rustc-std-workspace-core v1.99.0 (/home/glindstedt/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/rustc-std-workspace-core)
error: ran out of registers during register allocation
Anyone else run into this?
profile.dev
, and for the second issue I just found this which had a workaround at the end rust-lang/compiler-builtins#400
llvm.global_ctors
works properly in our AVR LLVM? I just started using clang to compile a .cpp file and the llvm back end isn't doing what I expect. It's creating an init_array
section with pointers in there that seem to be twice what they should be (a standard AVR problem in various places we have had to fix).
R_AVR_16
but should be of type R_AVR_16_PM
, no?