binaries: move MQTT_ADDRESS to design_parameters

until some better design with DHCP and/or (m)DNS is implemented
This commit is contained in:
Robert Jördens 2021-03-03 15:01:28 +01:00
parent baa2d0cdd5
commit e2b54d0e53
3 changed files with 17 additions and 16 deletions

View File

@ -6,10 +6,7 @@ use stm32h7xx_hal as hal;
use stabilizer::hardware; use stabilizer::hardware;
use miniconf::{ use miniconf::{minimq, Miniconf, MqttInterface};
embedded_nal::{IpAddr, Ipv4Addr},
minimq, Miniconf, MqttInterface,
};
use serde::Deserialize; use serde::Deserialize;
use dsp::iir; use dsp::iir;
@ -62,9 +59,12 @@ const APP: () = {
let mqtt_interface = { let mqtt_interface = {
let mqtt_client = { let mqtt_client = {
let broker = IpAddr::V4(Ipv4Addr::new(10, 34, 16, 10)); minimq::MqttClient::new(
minimq::MqttClient::new(broker, "", stabilizer.net.stack) hardware::design_parameters::MQTT_BROKER.into(),
.unwrap() "",
stabilizer.net.stack,
)
.unwrap()
}; };
MqttInterface::new( MqttInterface::new(

View File

@ -4,10 +4,7 @@
use generic_array::typenum::U4; use generic_array::typenum::U4;
use miniconf::{ use miniconf::{minimq, Miniconf, MqttInterface};
embedded_nal::{IpAddr, Ipv4Addr},
minimq, Miniconf, MqttInterface,
};
use serde::Deserialize; use serde::Deserialize;
use dsp::{Accu, Complex, ComplexExt, Lockin, RPLL}; use dsp::{Accu, Complex, ComplexExt, Lockin, RPLL};
@ -77,11 +74,12 @@ const APP: () = {
let (mut stabilizer, _pounder) = setup(c.core, c.device); let (mut stabilizer, _pounder) = setup(c.core, c.device);
let mqtt_interface = { let mqtt_interface = {
let mqtt_client = { let mqtt_client = minimq::MqttClient::new(
let broker = IpAddr::V4(Ipv4Addr::new(10, 34, 16, 10)); design_parameters::MQTT_BROKER.into(),
minimq::MqttClient::new(broker, "", stabilizer.net.stack) "",
.unwrap() stabilizer.net.stack,
}; )
.unwrap();
MqttInterface::new( MqttInterface::new(
mqtt_client, mqtt_client,

View File

@ -49,3 +49,6 @@ pub const ADC_SAMPLE_TICKS: u16 = 1 << ADC_SAMPLE_TICKS_LOG2;
// The desired ADC sample processing buffer size. // The desired ADC sample processing buffer size.
pub const SAMPLE_BUFFER_SIZE_LOG2: u8 = 3; pub const SAMPLE_BUFFER_SIZE_LOG2: u8 = 3;
pub const SAMPLE_BUFFER_SIZE: usize = 1 << SAMPLE_BUFFER_SIZE_LOG2; pub const SAMPLE_BUFFER_SIZE: usize = 1 << SAMPLE_BUFFER_SIZE_LOG2;
// The MQTT broker IPv4 address
pub const MQTT_BROKER: [u8; 4] = [10, 34, 16, 10];