More consistent bluetooth notify
This commit is contained in:
@ -29,9 +29,12 @@ fn main() {
|
||||
// Do basic initialization
|
||||
esp_idf_svc::sys::link_patches();
|
||||
esp_idf_svc::log::EspLogger::initialize_default();
|
||||
|
||||
// Set log level based on compiler flags
|
||||
#[cfg(debug_assertions)]
|
||||
log::set_max_level(log::LevelFilter::Trace);
|
||||
//TODO DEBUG: remove trace logging
|
||||
//log::set_max_level(log::LevelFilter::Info);
|
||||
#[cfg(not(debug_assertions))]
|
||||
log::set_max_level(log::LevelFilter::Info);
|
||||
|
||||
// Set panic to use error! instead of write! (as we will potentially log errors)
|
||||
panic::set_hook(Box::new(|panic_info| {
|
||||
@ -49,6 +52,7 @@ fn main() {
|
||||
error!("A panic occurred at {}:{}: {}", filename, line, cause);
|
||||
}));
|
||||
|
||||
// Start up our main loop
|
||||
match future::block_on(main_loop()) {
|
||||
Ok(_) => {error!("Exited main loop with no errors, but this should not happen."); panic!();}
|
||||
Err(e) => {error!("Exited main loop with error {}", e); panic!();}
|
||||
@ -62,7 +66,7 @@ async fn main_loop() -> Result<()> {
|
||||
let mut dp = dispatch::Dispatch::new();
|
||||
|
||||
// Debug Drivers (TODO DEBUG: remove debug)
|
||||
let motor_driver = motor_driver::MotorDriverDebug::new(dp.get_cmd_channel());
|
||||
let motor_driver = motor_driver::MotorDriverDebug::new();
|
||||
|
||||
// Setup of various drivers that need to out-live the executor
|
||||
let m_chan = motor_controller::Controller::prepare_controller(&mut dp);
|
||||
|
||||
Reference in New Issue
Block a user