Skip to content

Commit

Permalink
Merge pull request #356 from tinymovr/firmware/fix_can_setup
Browse files Browse the repository at this point in the history
Fix can initialization/setup
  • Loading branch information
yconst authored Jun 6, 2024
2 parents 6f41966 + 78b0684 commit bf4bb02
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
6 changes: 3 additions & 3 deletions firmware/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ int main(void)
{
__disable_irq();
system_init();
UART_Init();
ADC_init();
CAN_init();
UART_Init(); // Keep UART init before config load for now
if (!nvm_load_config())
{
sensors_init_with_defaults();
observers_init_with_defaults();
}
ADC_init();
CAN_init();
timers_init();
Watchdog_init();
__enable_irq();
Expand Down
1 change: 0 additions & 1 deletion studio/Python/tinymovr/bus_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ def recv(self, timeout):
self.attempt_reconnect()
except AttributeError:
self.attempt_reconnect()
return None

def shutdown(self):
try:
Expand Down
8 changes: 6 additions & 2 deletions studio/Python/tinymovr/gui/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import can
from PySide6 import QtCore
from PySide6.QtCore import QObject
from tinymovr.channel import ResponseError
from tinymovr.gui import TimedGetter, get_dynamic_attrs
from tinymovr.bus_router import init_router, destroy_router
from tinymovr.device_discovery import DeviceDiscovery
Expand Down Expand Up @@ -140,8 +141,11 @@ def _update(self):

def _device_appeared(self, device, node_id):
self.mutx.lock()
display_name = "{}{}".format(device.name, node_id)
self.logger.info("Found {} (uid {})".format(display_name, device.uid))
try:
display_name = "{}{}".format(device.name, node_id)
self.logger.info("Found {} (uid {})".format(display_name, device.uid))
except ResponseError as e:
self.handleErrorSignal.emit(e)
self.devices_by_name[display_name] = device
self.names_by_id[node_id] = display_name
device.name = display_name
Expand Down

0 comments on commit bf4bb02

Please sign in to comment.