Adding broken example

This commit is contained in:
Ryan Summers 2021-02-03 15:13:37 +01:00
parent 9e1a6ec4d5
commit 738516eedb
4 changed files with 34 additions and 9 deletions

26
Cargo.lock generated
View File

@ -348,6 +348,15 @@ dependencies = [
"memchr", "memchr",
] ]
[[package]]
name = "derive_stringset"
version = "0.1.0"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]] [[package]]
name = "derive_stringset" name = "derive_stringset"
version = "0.1.0" version = "0.1.0"
@ -364,7 +373,7 @@ version = "0.1.0"
dependencies = [ dependencies = [
"criterion", "criterion",
"libm", "libm",
"miniconf", "miniconf 0.1.0 (git+https://github.com/vertigo-designs/miniconf.git?branch=feature/mqtt-interface)",
"ndarray", "ndarray",
"rand", "rand",
"serde", "serde",
@ -617,12 +626,23 @@ dependencies = [
"autocfg", "autocfg",
] ]
[[package]]
name = "miniconf"
version = "0.1.0"
dependencies = [
"derive_stringset 0.1.0",
"heapless",
"minimq",
"serde",
"serde-json-core 0.2.0",
]
[[package]] [[package]]
name = "miniconf" name = "miniconf"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/vertigo-designs/miniconf.git?branch=feature/mqtt-interface#38379f7fa72e675c348a4f532811795cc95766df" source = "git+https://github.com/vertigo-designs/miniconf.git?branch=feature/mqtt-interface#38379f7fa72e675c348a4f532811795cc95766df"
dependencies = [ dependencies = [
"derive_stringset", "derive_stringset 0.1.0 (git+https://github.com/vertigo-designs/miniconf.git?branch=feature/mqtt-interface)",
"heapless", "heapless",
"minimq", "minimq",
"serde", "serde",
@ -1054,7 +1074,7 @@ dependencies = [
"heapless", "heapless",
"log", "log",
"mcp23017", "mcp23017",
"miniconf", "miniconf 0.1.0",
"nb 1.0.0", "nb 1.0.0",
"panic-halt", "panic-halt",
"panic-semihosting", "panic-semihosting",

View File

@ -46,8 +46,9 @@ dsp = { path = "dsp" }
ad9959 = { path = "ad9959" } ad9959 = { path = "ad9959" }
[dependencies.miniconf] [dependencies.miniconf]
git = "https://github.com/vertigo-designs/miniconf.git" # git = "https://github.com/vertigo-designs/miniconf.git"
branch = "feature/mqtt-interface" # branch = "feature/mqtt-interface"
path = "../../vertigo-designs/miniconf"
[dependencies.mcp23017] [dependencies.mcp23017]
git = "https://github.com/mrd0ll4r/mcp23017.git" git = "https://github.com/mrd0ll4r/mcp23017.git"
@ -70,7 +71,7 @@ pounder_v1_1 = [ ]
[profile.dev] [profile.dev]
codegen-units = 1 codegen-units = 1
incremental = false incremental = false
opt-level = 3 opt-level = 1
[profile.release] [profile.release]
opt-level = 3 opt-level = 3

View File

@ -27,15 +27,19 @@ const IIR_CASCADE_LENGTH: usize = 1;
#[derive(Debug, Deserialize, StringSet)] #[derive(Debug, Deserialize, StringSet)]
pub struct Settings { pub struct Settings {
test: u32,
} }
impl Settings { impl Settings {
pub fn new() -> Self { pub fn new() -> Self {
Self { Self {
test: 0,
} }
} }
} }
const ID: &str = "test";
#[rtic::app(device = stm32h7xx_hal::stm32, peripherals = true, monotonic = rtic::cyccnt::CYCCNT)] #[rtic::app(device = stm32h7xx_hal::stm32, peripherals = true, monotonic = rtic::cyccnt::CYCCNT)]
const APP: () = { const APP: () = {
struct Resources { struct Resources {
@ -56,10 +60,10 @@ const APP: () = {
// Configure the microcontroller // Configure the microcontroller
let (mut stabilizer, _pounder) = hardware::setup(c.core, c.device); let (mut stabilizer, _pounder) = hardware::setup(c.core, c.device);
let broker = IpAddr::V4(Ipv4Addr::new(10, 0, 0, 2)); let broker = IpAddr::V4(Ipv4Addr::new(10, 34, 16, 1));
let mqtt_interface = MqttInterface::new( let mqtt_interface = MqttInterface::new(
stabilizer.net.stack, stabilizer.net.stack,
"stabilizer/iir/dual", ID,
broker, broker,
Settings::new(), Settings::new(),
) )

View File

@ -60,7 +60,7 @@ const APP: () = {
// Configure the microcontroller // Configure the microcontroller
let (mut stabilizer, _pounder) = hardware::setup(c.core, c.device); let (mut stabilizer, _pounder) = hardware::setup(c.core, c.device);
let broker = IpAddr::V4(Ipv4Addr::new(10, 0, 0, 2)); let broker = IpAddr::V4(Ipv4Addr::new(10, 34, 16, 1));
let mqtt_interface = MqttInterface::new( let mqtt_interface = MqttInterface::new(
stabilizer.net.stack, stabilizer.net.stack,
"stabilizer/lockin", "stabilizer/lockin",