Code Monkey home page Code Monkey logo

ruduino's Introduction

Ruduino

This library provides a set of reusable components for the Arduino Uno.

Overview

Register and bit definitions

use ruduino::cores::current::PORTB;  // Register
use ruduino::cores::current::PORTB7; // Pin

Prelude

Disable interrupts.

without_interrupts(|| {
    unsafe { write_volatile(DDRB, 0xFF) }
})

Timers

Configure a timer.

const DESIRED_HZ_TIM1: f64 = 2.0;
const TIM1_PRESCALER: u64 = 1024;
const INTERRUPT_EVERY_1_HZ_1024_PRESCALER: u16 =
    ((ruduino::config::CPU_FREQUENCY_HZ as f64 / (DESIRED_HZ_TIM1 * TIM1_PRESCALER as f64)) as u64 - 1) as u16;

timer1::Timer::new()
    .waveform_generation_mode(timer1::WaveformGenerationMode::ClearOnTimerMatchOutputCompare)
    .clock_source(timer1::ClockSource::Prescale1024)
    .output_compare_1(Some(INTERRUPT_EVERY_1_HZ_1024_PRESCALER))
    .configure();

Set up an interrupt handler that will be called when the timer fires.

#[no_mangle]
pub unsafe extern "avr-interrupt" fn _ivr_timer1_compare_a() {
    let prev_value = read_volatile(PORTB);
    write_volatile(PORTB, prev_value ^ PINB5);
}

Hardware Serial Port

Configure the serial port.

const BAUD: u64 = 9600;
const UBRR: u16 = (ruduino::config::CPU_FREQUENCY_HZ / 16 / BAUD - 1) as u16;

serial::Serial::new(UBRR)
    .character_size(serial::CharacterSize::EightBits)
    .mode(serial::Mode::Asynchronous)
    .parity(serial::Parity::Disabled)
    .stop_bits(serial::StopBits::OneBit)
    .configure();

Transmit a sequence of bytes.

for &b in b"OK" {
    serial::transmit(b);
}

Read a byte if there's something available.

if let Some(b) = serial::try_receive() {
    serial::transmit(b);
    serial::transmit(b);
}

ruduino's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ruduino's Issues

Relationship with Embedded-HAL

What is the logical relationship between this project and Embedded-HAL? Would it make sense to modify this code (or fork a portion of the code) and make into an Embedded-HAL implementation for ATMega328p? It seems like that would enable the usage of all the available drivers on the Arduino Uno. But maybe there's more complexity here of which I'm unaware.

contributing other boards

I just tried out this framework on the leonardo/promicro/atmega32u4 and had to change some addresses around to get for example serial working, but I guess the rest need some tweaking too. Do you have any nice idea on how to have different boards in the same code base?

When the ruduino compile, that fail by support error for LLVM.

Hi All.

I'm trying compile ruduino on own project.
But, It do fail compile by LLVM support error.

% rustup override set nightly
info: using existing install for 'nightly-x86_64-apple-darwin'
info: override toolchain for '/Users/himrock922/Desktop/Develop/eddie' set to 'nightly-x86_64-apple-darwin'

  nightly-x86_64-apple-darwin unchanged - rustc 1.51.0-nightly (8a6518427 2021-01-16)

% rustup run cargo build -Z build-std=core --target avr-atmega328p.json --release --verbose

   Compiling ruduino v0.2.7
     Running `rustc --crate-name ruduino --edition=2018 /Users/himrock922/.cargo/registry/src/github.com-1ecc6299db9ec823/ruduino-0.2.7/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no --cfg 'feature="avr-std-stub"' --cfg 'feature="default"' -C metadata=e7ee6d9ba5f8f19c -C extra-filename=-e7ee6d9ba5f8f19c --out-dir /Users/himrock922/Desktop/Develop/eddie/target/avr-atmega328p/release/deps --target /Users/himrock922/Desktop/Develop/eddie/avr-atmega328p.json -L dependency=/Users/himrock922/Desktop/Develop/eddie/target/avr-atmega328p/release/deps -L dependency=/Users/himrock922/Desktop/Develop/eddie/target/release/deps --extern avr_std_stub=/Users/himrock922/Desktop/Develop/eddie/target/avr-atmega328p/release/deps/libavr_std_stub-4c2127b209c7e5fe.rmeta --extern 'noprelude:compiler_builtins=/Users/himrock922/Desktop/Develop/eddie/target/avr-atmega328p/release/deps/libcompiler_builtins-489f13d764afd079.rmeta' --extern 'noprelude:core=/Users/himrock922/Desktop/Develop/eddie/target/avr-atmega328p/release/deps/libcore-3027a7a692d31aa1.rmeta' --extern target_cpu_macro=/Users/himrock922/Desktop/Develop/eddie/target/release/deps/libtarget_cpu_macro-9226fab6ffe884c4.dylib -Z unstable-options --cap-lints allow --cfg avr_mcu_atmega328p`
LLVM ERROR: Not supported instr: <MCInst 258 <MCOperand Reg:1> <MCOperand Imm:15> <MCOperand Reg:45>>
error: could not compile `compiler_builtins`

Where should I confirm with source code or library?

Versions

  • LLVM
Apple clang version 12.0.0 (clang-1200.0.32.28)
Target: x86_64-apple-darwin20.2.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
  • rustup
rustup --version 
rustup 1.23.1 (3df2264a9 2020-11-30)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.51.0-nightly (8a6518427 2021-01-16)`
  • rustc
rustc --version
rustc 1.51.0-nightly (8a6518427 2021-01-16)
  • cargo
% cargo --version
cargo 1.51.0-nightly (a73e5b7d5 2021-01-12)
  • nightly
% rustup show
Default host: x86_64-apple-darwin
rustup home:  /Users/himrock922/.rustup

installed toolchains
--------------------

stable-x86_64-apple-darwin (default)
nightly-x86_64-apple-darwin

active toolchain
----------------

nightly-x86_64-apple-darwin (directory override for '/Users/himrock922/Desktop/Develop/eddie')
rustc 1.51.0-nightly (8a6518427 2021-01-16)
  • avr-binutils
% brew info avr-binutils
osx-cross/avr/avr-binutils: stable 2.35.1 (bottled)

% avr-gcc

% brew info avr-gcc
osx-cross/avr/avr-gcc: stable 9.3.0 (bottled)

avr-atmega328p.json

{
  "arch": "avr",
  "cpu": "atmega328p",
  "data-layout": "e-P1-p:16:8-i8:8-i16:8-i32:8-i64:8-f32:8-f64:8-n8-a:8",
  "env": "",
  "executables": true,
  "linker": "avr-gcc",
  "linker-flavor": "gcc",
  "linker-is-gnu": true,
  "llvm-target": "avr-unknown-unknown",
  "no-compiler-rt": true,
  "os": "unknown",
  "position-independent-executables": false,
  "exe-suffix": ".elf",
  "eh-frame-header": false,
  "pre-link-args": {
    "gcc": [
      "-Os",
      "-mmcu=atmega328p"
    ]
  },
  "late-link-args": {
    "gcc": [
      "-lc",
      "-lgcc"
    ]
  },
  "target-c-int-width": "16",
  "target-endian": "little",
  "target-pointer-width": "16",
  "vendor": "unknown"
}

Cargo.toml

[package]
name = "eddie"
version = "0.1.0"
authors = ["himrock922 <*****>"]
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]

ruduino = "0.2.7"

What is the scope / planned level of this library going forward?

Hi! I'm looking to code Rust on Arduino. I love the Arduino platform, and Rust intrigues me. I just have a couple questions:

Is this designed to be a low level library? Are there plans to make it higher level (less unsafe code, for instance)? What is the scope of this library going forward?

Thanks in advance! 😄

PS: Sorry if this is the wrong place for questions, I wasn't sure.

"out of registers" build error

avr-gcc 5.4
ruduino 0.3.2

Compiling rustc-std-workspace-core v1.99.0 (/home/m/.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

error: could not compile core due to previous erro

#[feature(const_fn)] removed on latest rust nightly

When trying to compile an example program, I get this error from the ruduino crate:

error[E0557]: feature has been removed
 --> /home/ggsvr/.cargo/registry/src/github.com-1ecc6299db9ec823/ruduino-0.3.2/src/lib.rs:4:12
  |
4 | #![feature(const_fn)]
  |            ^^^^^^^^ feature has been removed
  |
  = note: split into finer-grained feature gates

I get another error from LLVM "Not supported instr", but I don't think they're related.

Write trait doesn't work for serial

Hello,

I have tried to implement the Write trait for the Serial struct and I haven't succeed making the write_fmt work.

Both write_str and write_char works well and I can't seem to understand why the write_fmt doesn't work. I don't have many experience with rust so maybe you can figure out what is not working. I though since write_str is working well and as write_fmt is implemented in Write trait, it should be working.

Here is the simple implementation I did :

impl Write for Serial {
    fn write_str(&mut self, s: &str) -> core::fmt::Result {
        for &b in s.as_bytes() {
            transmit(b);
        }
        Ok(())
    }
}

Thanks in advance

Add .devcontainer

Please help to add a .devcontainer for this project to be able to use Github Codespaces.

ATmega32U4 support: collect register definitions from multiple modules

I'd like to use Rust to develop for the ArduBoy, which uses an ATmega32U4, which I believe is the same mcu as used on the Arduino Leonardo. So there should be quite a lot of boards out there using it.

Ruduino's core_generator chokes on the 16u4 and the 32u4 as-is because they have PDI and PDO pins in their SPI definition. I think these can be safely ignored as they are only used for in-circuit programming.

However, if we get over this hump, we get a more severe problem: registers that are defined "piecewise" at multiple locations in the packfile. For example, on the 32u4 ADCSRB is defined in two modules, in AC and in ADC. With core_generator's naive handling of registers, these end up as duplicate definitions in atmega32u4.rs:

#[allow(non_camel_case_types)]
pub struct ADCSRB;

impl ADCSRB {
    pub const ACME: RegisterBits<Self> = RegisterBits::new(0x40);
    pub const ACME0: RegisterBits<Self> = RegisterBits::new(1<<6);

}

impl Register for ADCSRB {
    type T = u8;
    const ADDRESS: *mut u8 = 0x7b as *mut u8;
}
#[allow(non_camel_case_types)]
pub struct ADCSRB;

impl ADCSRB {
    pub const ADHSM: RegisterBits<Self> = RegisterBits::new(0x80);
    pub const ADHSM0: RegisterBits<Self> = RegisterBits::new(1<<7);

    pub const MUX5: RegisterBits<Self> = RegisterBits::new(0x20);
    pub const MUX50: RegisterBits<Self> = RegisterBits::new(1<<5);

    pub const ADTS: RegisterBits<Self> = RegisterBits::new(0x17);
    pub const ADTS0: RegisterBits<Self> = RegisterBits::new(1<<0);
    pub const ADTS1: RegisterBits<Self> = RegisterBits::new(1<<1);
    pub const ADTS2: RegisterBits<Self> = RegisterBits::new(1<<2);
    pub const ADTS3: RegisterBits<Self> = RegisterBits::new(1<<4);

}

impl Register for ADCSRB {
    type T = u8;
    const ADDRESS: *mut u8 = 0x7b as *mut u8;
}

Timer configuration for interruptless mode

I'd like to configure a timer for CTC mode with polling instead of interrupts. Unfortunately, this is not possible at the moment because setting the comparator target is coupled with turning on interrupts:

    pub fn configure(self) {
        T::ControlA::write(self.a);
        T::ControlB::write(self.b);
        T::ControlC::write(self.c);

        // Reset counter to zero
        T::Counter::write(0u16);

        if let Some(v) = self.output_compare_1 {
            // Set the match
            T::CompareA::write(v);

            // Enable compare interrupt
            T::InterruptMask::set(T::OCIEA);
        }
    }

I think these should be exposed as two orthogonal features.

Docs.rs is complaining this won't compile

I can't seem to get documentation for any version newer than 0.1.2 because "docs.rs failed to build ruduino-0.2.0"

This seems to be the same issue as here: avr-rust/blink#25, I did a quick test and was able to confirm build failure and was able to get it working using the same fix I suggested there (included below for your reference).

Cargo.toml

[profile.dev]
opt-level = "s"
debug-assertions = false

[profile.release]
opt-level = "s"

Interrupt handler symbol name incorrect?

The README shows

pub unsafe extern "avr-interrupt" fn _ivr_timer1_compare_a() {

as interrupt handler for timer1 but that didn't work for me on the Arduino Uno Rev3.

Every time the interrupt arrived, the board did a full reset because no interrupt handler was correctly defined.

This worked:

pub unsafe extern "C" fn __vector_11() {

as that is what ISR(TIMER1_COMPA_vect) (see e.g. here) expands to when used from the Arduino IDE.

Automatically optimise multi-pin access

This feature request is for something like Marangisto's AVR library in C++, i.e. something that allows bunching of pins in such a way that reads/writes are optimized to take advantage of shared registers. In other words, if I bunch up the pins PINB0, PINB1, PINB2, PINB3, PINC4, PINC2, PINB6, PINC0 into an 8-bit value, I should be able to read/write this 8-bit value with just two reads/writes (one for PORTB and one for PORTC).

If you compile this example you will see that bits::write(i++) compiles to a single write to PORTC.

Compiling for ATmega4809; "no register group defined for this port"

Hiya,

First of all, thanks all for all the work on Rust/AVR, it's awesome :).

Secondly though, I'm trying to get Rust working with the Arduino Nano Every board (electrically (and cost-wise) it's perfect for my project), which uses the ATmega4809 chip...

It turns out this is quite tricky and I've been going round in a few loops, but right now I'm stuck at getting ruduino to build. avr-mcu seems to load the packfile OK, but ruduino doesn't like what it sees:

[Sasha:rust/rust-arduino-blink] timwa% cargo build
   Compiling rustc-std-workspace-core v1.99.0 (/Users/timwa/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/rustc-std-workspace-core)
   Compiling ruduino v0.2.6
   Compiling compiler_builtins v0.1.35
error: failed to run custom build command for `ruduino v0.2.6`

Caused by:
  process didn't exit successfully: `/Volumes/Development/Arduino/rust/rust-arduino-blink/target/debug/build/ruduino-1f365ea4228ae98b/build-script-build` (exit code: 101)
  --- stdout
  loading pack '/Users/timwa/.cargo/registry/src/github.com-1ecc6299db9ec823/avr-mcu-0.3.4/packs/atmega/ATmega4809.atdf'

  --- stderr
  [warning]: cannot find target JSON file 'atmega4809.json' - due to limitations it needs to be in the crate root - is it?
  [warning]: assuming a target CPU name of 'atmega4809' from the file name of the target spec JSON file
  thread 'main' panicked at 'no register group defined for this port', /Users/timwa/.cargo/registry/src/github.com-1ecc6299db9ec823/ruduino-0.2.6/core_generator/gen.rs:65:22
  stack backtrace:
     0:        0x1044d20a4 - std::backtrace_rs::backtrace::libunwind::trace::hb4ff9014ec5817b3
                                 at /rustc/7bade6ef730cff83f3591479a98916920f66decd/library/std/src/../../backtrace/src/backtrace/libunwind.rs:100:5
     1:        0x1044d20a4 - std::backtrace_rs::backtrace::trace_unsynchronized::h0d03cf0f7c5d8d01
                                 at /rustc/7bade6ef730cff83f3591479a98916920f66decd/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
     2:        0x1044d20a4 - std::sys_common::backtrace::_print_fmt::h5b2bf2921eea85ae

Before I start digging too deep attempting to work out the problem myself, does this seem to have an obvious cause to anyone (and thus an obvious solution? :-D.)

Thanks in advance,
Tim

other atmega than src/cores

Hi Guys,

wanted to ask. If i want to try this out with atmega2560 what needs to be doing?
Were those files created by hand or is there a magical script for easier generation?

Thank you for your feedback.

`Register` trait is unsound

Register trait allows reading and writing any pointer in safe code which is unsound.

Example:

use ruduino::Register;

struct Unsound;

impl Register for Unsound {
    type T = u8;

    const ADDRESS: *mut Self::T = core::ptr::null_mut();

    // default implementations of `write`, `read`, `set_musk_raw`, `toggle_raw`, 
    // `is_mask_set_raw` and `is_clear_raw` dereference `Self::ADDRESS`
    // (other methods also depend on them)
}

fn main() {
    println!("{}", Unsound::read());
}

(for me in debug it produces Process finished with exit code 139 (interrupted by signal 11: SIGSEGV) and in the release mode it prints 0)

Possible solutions:

  • make Register trait unsafe
  • do not provide unsound default impls

Rust on an arduino Leonardo

I recently got a shiny new keyboard from https://shop.keyboard.io/ :)

I am truly loving the hardware, but given that all of the configuration is done in arduino c it makes me a bit sad. I have been spending some time looking into rust and enjoying the zero cost abstractions and the convenient type systems. This all got me thinking that I would really love to be able to program for my keyboard in rust. The existing firmware for it is highly plugin based which would be a great fit for rusts crate system and is currently pretty annoying to get working in arduino c/c++.

All of this lead me to this repo and organization. I am pretty new to arduino/avr programming however so I have a couple of questions.

First: How likely is using something like avr-rust on an arduino leonardo to be successful? Will I need to be extra careful with progmem when compared to a c version? Does rust have a large standard library which will take up too much space or is it relatively bare bones? My guess is that this is entirely up to me as I will have to recompile core anyways, but I'm not sure.

Second: What is the status of rust on avr. I saw a couple of threads in the main repo indicating that rust was updated to the correct version of LLVM, but I also saw that there are some outstanding bugs with LLVM which makes things difficult including i128 types not working. Are these insurmountable at the moment or is there a happy path for ignoring them?

Third: I saw a separate issue and pull request related to adding support for different boards, I think, this would be necessary for building firmware for my keyboard as it is based on the leonardo instead of the uno. Is this still something for which progress is being made or am I left in the dark?

I'm not sure if this is the correct place to ask these questions. Sorry if not. Clearly I am not super experienced with microcontroller programming, so any assistance in this project would be greatly appreciated!

wish: publish at crates.io

Currently this

$ AVR_CPU_FREQUENCY_HZ=8_000_000 cargo +nightly publish --target ./avr-atmega328p.json -Z build-std=core
    Updating crates.io index
   Packaging ruduino v0.4.0 (/home/gs0604/src/rust/RustAVR/ruduino)
error: failed to prepare local package for uploading

Caused by:
  failed to select a version for the requirement `avr_delay = "^0.4.0"`
  candidate versions found which didn't match: 0.3.2, 0.3.1, 0.3.0, ...
  location searched: crates.io index
  required by package `ruduino v0.4.0 (/home/stappers/src/rust/RustAVR/ruduino)`

I think the

  failed to select a version for the requirement `avr_delay = "^0.4.0"`
  candidate versions found which didn't match: 0.3.2, 0.3.1, 0.3.0, ...

means that avr-rust/delay#21 has to fixed first ...

Shouldn't all IO registers use volatile operations?

    fn toggle_raw(mask: Self::T) {
        unsafe {
            *Self::ADDRESS ^= mask;
        }
    }

As I understand it, without using volatile operations, the compiler can see something like port = on; port = off; port = on and optimize that to just port = on.

How do I read/write analog values

I don't seem to find a way to read analog input using this library. I suppose that it is either not currently supported or considered too high level for this library.

Is there an example on to achieve this (read and possibly write analog values) using Rust?

without_interrupts(): Restore previous interrupt state rather than always re-enabling interrupts

The without_interrupts() in PR #4 always enables interrupts when the closure finishes executing.

This could be problematic in libraries; a library using this function assumes that the program it is included in actually wants interrupts to be disabled, or even if interrupts were already disabled before the call to without_interrupts

We should make a copy of the the interrupt flag in the status register, and then restore the interrupt flag back to its previous state, not just re-enabled it.

Unified interrupt handler interface

CC #9

Our interrupt handler story isn't super great; we require users to write their own interrupt vector table (IVT) in assembly, and then they define a set of pub unsafe extern "avr-interrupt" fn <interrupt handler symbol name>() { } that the IVT points to.

Here's an example program that installs interrupt handlers.

We should come up with a single, unified method of defining interrupt handlers. All AVR-Rust programs should use the same interrupt handler function names, by convention. This is similar to AVR-GCC, which always uses the same function names, although GCC has much more abbreviated, hard-to-understand names. Let's be more descriptive.

cores to structs (code architecture)

now, we can use components like this
ruduino::cores::atmega328p::SOMETHING
atmega328p is a module and SOMETHING is struct with static functions

but what if atmega328p is struct that implements trait Something

trait Something {
    const SOMETHING: TypeOfSomething;
}

and implement Something for atmega328p

impl Something for atmega328p {
    const SOMETHING: TypeOfSomething = ~~;
}

we can still access to Something

now assume there are an arduino library that needs Something to work
at this time library is Serial
when writing implemention of Serial

impl<T: Something> Serial for T {
    fn job() {
        //job uses Self::SOMETHING
    }
}

will be ok and we can use
atmega328p::job()

Make `Register::set` use `volatile_write`

I was writing a small programs that uses the internal EEPROM of the ATmega328P, when I noticed that no writing was occuring.
I was using

EECR::set(EECR::EEMPE);
EECR::set(EECR::EEPE);

to start writing to the EEPROM, but the memory was unchanged.

When I replaced the above code with the following:

EECR::write(EECR::EEMPE);
EECR::write(EECR::EEPE);

it worked like a charme.

I might be mistaken, but after digging through the Register code, I noticed that Register::set is not using volatile_write

ruduino/src/register.rs

Lines 53 to 57 in 302095d

fn set_mask_raw(mask: Self::T) {
unsafe {
*Self::ADDRESS |= mask;
}
}

while Register::unset, Register::write, etc are doing so. Is there a particular reason for this, that I may not understand yet?

ruduino/src/register.rs

Lines 70 to 74 in 302095d

fn unset_mask_raw(mask: Self::T) {
unsafe {
core::ptr::write_volatile(Self::ADDRESS, core::ptr::read_volatile(Self::ADDRESS) & !mask)
}
}

Thanks!

Where does `timer1` in the README come from?

The README has the following code snipped:

const DESIRED_HZ_TIM1: f64 = 2.0;
const TIM1_PRESCALER: u64 = 1024;
const INTERRUPT_EVERY_1_HZ_1024_PRESCALER: u16 =
    ((ruduino::config::CPU_FREQUENCY_HZ as f64 / (DESIRED_HZ_TIM1 * TIM1_PRESCALER as f64)) as u64 - 1) as u16;

timer1::Timer::new()
    .waveform_generation_mode(timer1::WaveformGenerationMode::ClearOnTimerMatchOutputCompare)
    .clock_source(timer1::ClockSource::Prescale1024)
    .output_compare_1(Some(INTERRUPT_EVERY_1_HZ_1024_PRESCALER))
    .configure();

I'm interested in using similar code to configure a timer. But where is the variable timer1 coming from?

#![feature(unwind-attributes)] has been removed?

I’m trying to compile a basic program that blinks my ATmega328p, but whenever I compile my code I get the following error message:

error[E0557]: feature has been removed
 --> /Users/ryan/.cargo/registry/src/github.com-1ecc6299db9ec823/ruduino-0.3.2/src/lib.rs:8:12
  |
8 | #![feature(unwind_attributes)]
  |            ^^^^^^^^^^^^^^^^^ feature has been removed
  |
  = note: use the C-unwind ABI instead

This problem seems to be close to the #![feature(const_fn)] has been removed problem, but that could be solved by just removing the #![feature(const_fn)] line from the imported crate. Yet, If I delete the #![feature(unwind_attributes)] line, I’ll get the following error:

error: language item required, but not found: `eh_personality`

error: `#[panic_handler]` function required, but not found

error: could not compile `avr-projects` due to 2 previous errors

Enable all cores when building documentation

Currently, the build script has a special case when not targeting AVR; default to atmega328 so that docs.rs can build it.

We should build all cores when generating documentation, so that the documentation is applicable to more than one device.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.