18 Commits

Author SHA1 Message Date
953b7a348a feat(test): BLE test mode for validating alerts, CAN speed, and buzzer
Add TEST_ENTER/TEST_EXIT commands via BLE to enter/exit test mode.
In test mode, inference results are suppressed; testers can directly
trigger BLE JSON (TEST_BLE *), CAN+Buzzer actions (TEST_CAN *),
or run sequenced full-coverage tests (TEST_BLE_ALL, TEST_CAN_ALL,
TEST_ALL). Auto-exits after 60s idle. Routes unrecognised BLE
commands through new bt_uart_set_extra_cmd_cb() hook.
2026-06-13 18:12:05 +08:00
286291fcfd feat(buzzer): add GPIO64 buzzer module with pattern-based alerts
New buzzer.h/buzzer.c: background pthread drives gpio64 with three
patterns (GRASS 500/500ms, ALERT 300/200ms, COLLISION 100/100ms).
Integrated into fire_collision_warning(), fire_alert(), and grass
state machine in event_recorder.c; buzzer_init() called after
can_bus_init() in kp_firmware.c.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-12 18:09:54 +08:00
fd54f5cc0b feat(can/rx): MCP2515 CAN RX interrupt thread for ECU ID 0x50
- can_bus.h: add can_ecu_status_t struct + can_bus_get_ecu_status() declaration
- can_bus.c: add gpio_interrupt_init() (gpio sysfs, falling-edge poll)
- can_bus.c: add can_rx_thread() - poll gpio63 INT pin, parse 0x50 frame
  (throttle_status, pedal_volt, led_flash_timer, can_lose_ecu, throttle_limit_off, heart_beam)
  with CAN_LOSE timeout detection (100ms)
- can_bus.c: start/join can_rx thread in can_bus_init()/can_bus_close()
- can_bus.c: add can_bus_get_ecu_status() thread-safe snapshot

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-12 16:47:18 +08:00
e108bfe13a feat(can): add LED control fields to can_ctrl_cmd_t, CAN speed in fire_* callbacks
- can_bus.h: add can_ctrl_cmd_t struct (speed/led_gpio/led_enable/keepalive_interval_ms)
- can_bus.c: rename s_keepalive_cmd->s_keepalive_speed; add s_keepalive_led_gpio/
  led_enable/interval_ms; keepalive thread supports LED blink (toggle when
  led_enable=1) and dynamic interval; remove #define CAN_KEEPALIVE_INTERVAL_MS
- event_recorder: fire_collision_warning sends SPEED_LIMIT_STOP/NORMAL via CAN
- event_recorder: fire_alert sends SPEED_LIMIT_ALERT/NORMAL via CAN
- event_recorder/app_header_init: update callers to use can_ctrl_cmd_t struct

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-12 15:14:17 +08:00
118d0f4d93 feat(can/ble): vehicle-triggered CAN speed control + BLE can_status notify
- app_header_init: detect vehicle(class=2) in print_yolo_result(),
  send CAN speed=10 on detection, speed=240 on clear;
  only triggers on state change, keepalive maintains cmd
- app_header_init: on speed state change, send BLE JSON
  {response_type:can_status, content:{vehicle_detected, speed_cmd}}
- app_header_init: add #include can_bus.h / bt_uart.h
- event_recorder: wrap legacy MsgBroker IPC path in #if 0;
  setSpeed now goes directly through can_bus_send_control_cmd()
2026-06-10 17:25:52 +08:00
f5ce719ea1 chore: fix CRLF line endings in shell scripts and source files
- Convert CRLF to LF in all .sh files (compile.sh, tools/device/*.sh, include/**/*.sh)
- Renormalize app_header_init.c to LF via .gitattributes eol=lf rule
- .gitattributes (*.sh, *.c, *.h, *.py, *.ini, Dockerfile eol=lf) already committed in 7fb534d

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-08 16:22:23 +08:00
7fb534dde3 chore: enforce LF line endings via .gitattributes 2026-06-08 16:19:16 +08:00
a600f38767 Fix error sync from v4 2026-06-08 16:11:49 +08:00
b9b298e466 feat: sync from v4 - bbox colour by class, collision warning debounce, clean build option 2026-06-08 15:34:47 +08:00
839100c0e1 BT handshake function complete 2026-06-08 14:49:20 +08:00
b6928e3ee7 Fix compile.sh and remove build folder 2026-04-13 14:31:12 +08:00
548cec2d4f fix hdmi mode DrawBox amd BT output 2026-04-13 10:51:34 +08:00
a3f3b2f8fc fix hdmi mode DrawBox amd BT output 2026-04-13 10:41:38 +08:00
9d7d9073a5 add source codes 2026-04-12 17:47:54 +08:00
4d27951ea6 上傳檔案到「docs」 2026-04-12 09:42:04 +00:00
c50bde13c4 上傳檔案到「ini」 2026-04-12 09:41:14 +00:00
e02f965b79 上傳檔案到「/」 2026-04-12 09:40:41 +00:00
7e40e52a0e 上傳檔案到「/」 2026-04-12 09:40:04 +00:00