mirror of
https://github.com/ferrous-systems/embedded-trainings-2020.git
synced 2024-05-09 20:13:12 +00:00
75f41a47c4
- VS: you can open more than one folder in the same VS workspace - current folder in VS code needs to be set to beginner/apps for "Run" to appear - rename `lsusb` to `usb-list` - recommend `usb-list` over `lsusb` - make `serial-term` behave like `screen`
26 lines
563 B
Rust
26 lines
563 B
Rust
#![deny(unused_must_use)]
|
|
#![no_main]
|
|
#![no_std]
|
|
|
|
use cortex_m::asm;
|
|
use cortex_m_rt::entry;
|
|
use dk::ieee802154::{Packet, Channel, TxPower};
|
|
use panic_log as _; // the panicking behavior
|
|
|
|
#[entry]
|
|
fn main() -> ! {
|
|
let board = dk::init().unwrap();
|
|
let mut radio = board.radio;
|
|
|
|
// these are the initial settings
|
|
radio.set_channel(Channel::_20);
|
|
radio.set_txpower(TxPower::Pos8dBm);
|
|
|
|
let mut packet = Packet::new();
|
|
packet.copy_from_slice(b"Hello");
|
|
let res = radio.try_send(&packet);
|
|
log::info!("{:?}", res);
|
|
|
|
dk::exit();
|
|
}
|