STM32 firmware: - safety.h/c: EstopSource enum, safety_remote_estop/clear/get/active() CDC 'E'=ESTOP_REMOTE, 'F'=ESTOP_CELLULAR_TIMEOUT, 'Z'=clear latch - usbd_cdc_if: cdc_estop_request/cdc_estop_clear_request volatile flags - status: status_update() +remote_estop param; both LEDs fast-blink 200ms - main.c: immediate motor cutoff highest-priority; arming gated by !safety_remote_estop_active(); motor estop auto-clear gated; telemetry 'es' field 0-4; status_update() updated to 5 args Safety: IMMEDIATE motor cutoff, latched until explicit Z + DISARMED, cannot re-arm via MQTT alone (requires RC arm hold). IWDG-safe. Jetson bridge: - remote_estop_node.py: paho-mqtt + pyserial, cellular watchdog 5s - estop_params.yaml, remote_estop.launch.py - setup.py / package.xml: register node + paho-mqtt dep - docker-compose.yml: remote-estop service - test_remote_estop.py: kill/clear/watchdog/latency unit tests Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
21 lines
543 B
C
21 lines
543 B
C
#ifndef USBD_CDC_IF_H
|
|
#define USBD_CDC_IF_H
|
|
|
|
#include "usbd_cdc.h"
|
|
|
|
extern USBD_CDC_ItfTypeDef USBD_CDC_fops;
|
|
|
|
/* Send data over USB CDC */
|
|
uint8_t CDC_Transmit(uint8_t *buf, uint16_t len);
|
|
|
|
/* Betaflight-style DFU reboot check — call early in main() */
|
|
void checkForBootloader(void);
|
|
|
|
/* PID tuning command interface (written by USB IRQ, read by main loop) */
|
|
extern volatile uint8_t cdc_cmd_ready;
|
|
extern volatile char cdc_cmd_buf[32];
|
|
|
|
extern volatile uint8_t cdc_estop_request;
|
|
extern volatile uint8_t cdc_estop_clear_request;
|
|
#endif
|