14 Commits

Author SHA1 Message Date
b2321fcdca feat(detect): make detection thresholds runtime-tunable via BLE SET / INI
Replace 11 compile-time THR_* #defines with runtime float globals
(g_thr_grass_roi, g_thr_*_collision, g_thr_*_alert) defined in
stdc_post_process.c and exposed via extern in the header.

- ini/host_stream.ini: add [detect] section with integer promille values
- kp_firmware.c: read [detect] section at startup, log initial values
- event_recorder.c: add 11 BLE SET handlers (THR_GRASS_ROI,
  THR_PERSON/CAR/TREE/BUNKER/POND_COL, THR_PERSON/CAR/TREE/BUNKER/POND_ALT)
  each with range validation (1-1000), runtime update, and INI persistence
- app_header_init.c: rename log field mov= to moving= for clarity
2026-07-19 22:52:08 +08:00
174200eb03 separate alert and collision threshold 2026-07-16 17:33:02 +08:00
2081c7b1f5 feat(upload): update OOB upload URL format and make CAN speeds INI-configurable
- Change upload URL path: golf.cgi -> golf-golface.cgi
- Add upload_dev INI key (1=dev, appends &dev=1 to URL)
- Change query params: ?filename= -> ?did={device_id}&vid={event_id}
- Add event_recorder_init params: device_id, dev_mode, speed_normal/alert/stop
- Make CAN speed limits configurable via [can] speed_normal/alert/stop in INI
  (replaces hardcoded SPEED_LIMIT_* macros with runtime static vars)
- Fix build_targz: use tar -C + mkdir -p for BusyBox compat;
  use open()+lseek() instead of stat() (struct stat ABI mismatch on target)
- Extend TEST_UPLOAD snapshot poll timeout: 5s -> 15s; same lseek fix
- Add BLE SET command: persist_ini_int() for runtime INI parameter update
- Fix app_header_init: elapsed_us long -> long long (overflow guard)
- Remove verbose debug printf from mcp2515 reset/send paths
- can_bus: wrap CTL log printf in #if 1 for easy toggle
2026-07-11 18:01:21 +08:00
83e2256192 Add Test_Upload item for development/product cloud 2026-07-06 15:02:11 +08:00
8278fae0ee Optimize SPI driver & web_server UIUX 2026-06-29 15:54:32 +08:00
41c0a781f2 Add remote control function with LED blinking test 2026-06-17 17:30:10 +08:00
c22b81dfba feat(can): update CAN 0x75 control frame layout for 16-bit speed and led_r/led_l
- can_ctrl_cmd_t.speed: uint8_t -> uint16_t (bytes 0-1, little-endian)
- Remove led_gpio field; add led_r (byte7 bit0) and led_l (byte7 bit7)
- byte6 now carries only led_enable (bit0), not the old gpio/enable packed format
- Update keepalive thread and can_bus_send_control_cmd() frame assembly accordingly
- Update all 6 can_ctrl_cmd_t call sites in event_recorder.c and app_header_init.c
- test_can_event() parameter type: uint8_t speed -> uint16_t speed
2026-06-17 11:42:01 +08:00
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
839100c0e1 BT handshake function complete 2026-06-08 14:49:20 +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