Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
1ba3418
ARK_G491_12S_CAN add target
AlexKlimaj Mar 31, 2026
28f996f
ARK_G431_CAN: set dead time to 500 ns (DTG=80 @ 160 MHz)
AlexKlimaj Jul 27, 2026
092b7dc
feat(ARK_G431_CAN): port ARK F051 vehicle policy + ZC + factory image
AlexKlimaj Jul 27, 2026
8ffc0c3
feat(ARK_G431_CAN): embed G431 CAN bootloader in factory image
AlexKlimaj Jul 27, 2026
cd83571
feat(ARK_G431_CAN): wire DRV8350H FAULT_N and ENABLE
AlexKlimaj Aug 3, 2026
0a097cd
feat: sleep DRV8350 ENABLE / DRV8328 nSLEEP when idle
AlexKlimaj Aug 3, 2026
4162dfe
chore(Bootloaders): G431 CAN BL holds DRV ENABLE low
AlexKlimaj Aug 3, 2026
0e860ea
feat(ARK_G431_CAN): debug UART on PB3 (USART2) for state and faults
AlexKlimaj Aug 4, 2026
0cb4516
feat(debug): log DroneCAN param sets; stop stuck fault spam
AlexKlimaj Aug 4, 2026
30106b0
feat(dronecan): auto-save params with deferred flash write (AM32#359)
AlexKlimaj Aug 4, 2026
4013452
fix(debug_uart): expose DBG_EVT_* for non-UART targets
AlexKlimaj Aug 4, 2026
28113a0
fix(dronecan): reapply kV/poles tables after live MOTOR_KV change
AlexKlimaj Aug 4, 2026
c252590
fix(G431): F051-scale ZC filters and softer acquisition desync
AlexKlimaj Aug 4, 2026
bda2655
feat(dronecan): NodeStatus health and one-shot fault LogMessages
AlexKlimaj Aug 4, 2026
416f975
feat(ARK_G431_CAN): 16x ADC hardware oversampling for current sense
AlexKlimaj Aug 4, 2026
5f9695b
fix(ARK_G431_CAN): remove CURRENT_OFFSET definition for idle current …
AlexKlimaj Aug 4, 2026
dd4c571
fix(dronecan): gate param set_log under USE_DEBUG_UART
AlexKlimaj Aug 4, 2026
e6e6ddb
fix(faults): do not treat commanded stop as stall; free HWCI flash
AlexKlimaj Aug 4, 2026
a90cd81
fix(desync): only count established jumps for error_count / WARNING
AlexKlimaj Aug 4, 2026
cd10ab8
feat(dronecan): report power_rating_pct from applied duty
AlexKlimaj Aug 4, 2026
39bcd81
fix: clear nFAULT without reboot; arm cleanly on 10 Hz DroneCAN
AlexKlimaj Aug 4, 2026
99539a4
fix(faults): latch established-run state for error_count gating
AlexKlimaj Aug 5, 2026
1ffe12c
fix(faults): split desync reporting from episode escalation
AlexKlimaj Aug 5, 2026
7ca8567
feat(hwci): G4 OpenOCD presets, app load addr, and ST-Link debug UART
AlexKlimaj Aug 5, 2026
3961942
feat(input): default AUTO; prefer live DroneCAN over DShot/PWM
AlexKlimaj Aug 5, 2026
da8a906
feat(g431): tune BEMF filter, ZC hump, and startup handoff for 12S CAN
AlexKlimaj Aug 5, 2026
fac203c
feat(hwci): no-prop BEMF characterization profiles and campaign summary
AlexKlimaj Aug 5, 2026
a0a0f15
fix(g431): bound acquisition stall grace in time, not throttle
AlexKlimaj Aug 6, 2026
0a5aae2
make format
AlexKlimaj Aug 6, 2026
0f10686
feat(g431): blank comparator output over the turn-on switching transient
AlexKlimaj Aug 6, 2026
5a3704d
feat(hwci): report closed-loop retention and per-tier fault attribution
AlexKlimaj Aug 6, 2026
491986c
fix(g431): arm COMP blanking per step and size it past the turn-on edge
claude Aug 6, 2026
2d1c618
feat(g431): make the post-commutation ZC search blank sweepable
claude Aug 6, 2026
5b9cff7
docs(g431): quantify why the hysteresis knob is out of room
claude Aug 6, 2026
27f9392
style(g431): restore peripherals.c indentation to the CI clang-format
claude Aug 6, 2026
4d51b9d
docs(g431): record ST COMP force-low blanking vs hold-last
AlexKlimaj Aug 7, 2026
2ef567b
feat(faults): classify nFAULT from bus V / current / temp ADC
AlexKlimaj Aug 7, 2026
7eb6f9d
docs(g431): lock ZC filter 48/12/9 after post-blanking A/B
AlexKlimaj Aug 7, 2026
1453770
fix(faults): define FAULT_HAS_DRV_NFAULT=0 when DRV nFAULT absent
AlexKlimaj Aug 8, 2026
35c7491
feat(dronecan): port upstream param table update (am32-firmware/AM32 …
claude Aug 9, 2026
316f34c
feat(limits): smooth composable thermal + current ceilings, armed on …
claude Aug 9, 2026
0a9b6bb
feat(dronecan): erase restores the shipped protection envelope
claude Aug 9, 2026
c7154cd
test(sitl): assert the derate curve against the reported degree
claude Aug 9, 2026
4f7b820
docs(dronecan): point CURRENT_P at the dead-zone note
claude Aug 9, 2026
a4ad5e2
feat(ARK_G431_CAN): ship 0.5 %/ms throttle ramp, and keep startup out…
claude Aug 9, 2026
2de9e5d
fix(ARK_G431_CAN): DRV8350 sleep-exit blip and BL ENABLE-low image
AlexKlimaj Aug 10, 2026
aee8e71
fix(dshot): require a repeat before throttle may leave zero
AlexKlimaj Aug 10, 2026
47af394
test(hwci): read-only SWD watcher that localises DShot frame loss
AlexKlimaj Aug 10, 2026
d2c336e
perf(g431): raise startup search blank to 40 for high-inertia props
AlexKlimaj Aug 10, 2026
56393f7
revert(g431): withdraw the startup search-blank 40 tune, back to 32
AlexKlimaj Aug 11, 2026
abb1db7
fix(limits): out-of-range thermal ceiling fails safe, not open
AlexKlimaj Aug 11, 2026
0d01b1d
make format
AlexKlimaj Aug 11, 2026
7b41d2b
feat(ARK_G431_CAN): PX4 SD-card signed UAVCAN image (board 0.71)
AlexKlimaj Aug 14, 2026
ff150a9
chore(Bootloaders): G431 CAN BL reports UAVCAN hw 0.71
AlexKlimaj Aug 14, 2026
ada913e
feat(Makefile): add optional debug UART source for G431
AlexKlimaj Aug 14, 2026
4f3f777
feat(ARK_G431_CAN): embed bootloader in the app for auto-update
AlexKlimaj Aug 14, 2026
bf04709
fix(ARK_G431_CAN): keep factory images off the PX4 SD-card glob
AlexKlimaj Aug 14, 2026
448dcc7
chore(ARK_G431_CAN): put the git hash in the UAVCAN filename
AlexKlimaj Aug 14, 2026
dae2329
fix(dronecan): stop LTO folding PX4 image_crc to zero
AlexKlimaj Aug 14, 2026
589a9b2
docs: note PX4 firmware-update behavior on the G431 ESC
AlexKlimaj Aug 14, 2026
cec3984
fix(dronecan): keep AUTO DShot after RawCommand
AlexKlimaj Aug 14, 2026
bc7200a
fix(hwci): do not flash .eeprom.bin as the app
AlexKlimaj Aug 14, 2026
e1296c9
fix(ARK_G431_CAN): do not treat DRV sleep nFAULT as a trip
AlexKlimaj Aug 20, 2026
b92754d
fix(ARK_G431_CAN): do not count PX4 arm/disarm as ESC errors
AlexKlimaj Aug 20, 2026
007ad16
style: format G431 stall-budget block after rebase
AlexKlimaj Aug 21, 2026
67c69b9
fix(ARK_G431_CAN): stop .file_name overflowing the 32-byte region
AlexKlimaj Aug 24, 2026
c89829d
feat(ARK_G431_CAN): CAN FD and in-tree G431 bootloader
AlexKlimaj Aug 25, 2026
de37223
fix(dronecan): send DNA as classic CAN, not CAN FD
AlexKlimaj Aug 26, 2026
037f584
fix(hwci): match find_artifact fixture to ARK32_ prefix
AlexKlimaj Aug 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions .github/workflows/CICD_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ name: CI Build Linux
# FLASH; native SITL on Windows is covered by the SITL workflow.)
#
# - Push/PR on ark-release: build + artifact.
# - Version tags (vMAJOR.MINOR[.PATCH][-suffix]): GitHub Release with obj/*.hex.
# - Version tags (vMAJOR.MINOR[.PATCH][-suffix]): GitHub Release with obj/*.hex and the G431 *.uavcan.bin.
# - schedule / optional dispatch: rolling `nightly` prerelease (assets replaced).

on:
Expand Down Expand Up @@ -112,6 +112,7 @@ jobs:
name: ARK32-binaries
path: |
obj/*.hex
obj/*.uavcan.bin
retention-days: 60
if-no-files-found: error

Expand All @@ -122,7 +123,9 @@ jobs:
github.repository == 'ARK-Electronics/ARK32'
uses: softprops/action-gh-release@v2
with:
files: obj/*.hex
files: |
obj/*.hex
obj/*.uavcan.bin
fail_on_unmatched_files: true
generate_release_notes: true
env:
Expand Down Expand Up @@ -155,7 +158,9 @@ jobs:
prerelease: true
make_latest: false
target_commitish: ${{ github.sha }}
files: obj/*.hex
files: |
obj/*.hex
obj/*.uavcan.bin
fail_on_unmatched_files: true
body: |
Rolling nightly firmware build for the ARK32 configurator and production line.
Expand Down
49 changes: 43 additions & 6 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,12 @@ jobs:
- name: Build ARK + codegen check
run: make codegen-check-ark -j$(nproc)

# Production full-flash image (BL + app + factory EEPROM). Fails if the
# 32 KiB layout or ARK 4IN1 ship defaults regress. See factory/README.md.
# Production full-flash images (BL + app + factory EEPROM). Fails if the
# flash layout or ARK ship defaults regress. See factory/README.md.
# Covers ARK_4IN1_F051 (32 KiB + committed BL) and ARK_G431_CAN (128 KiB
# + committed AM32_G431_BOOTLOADER_ARKG4_CAN under Bootloaders/).
factory-image:
name: factory image (ARK 4IN1 full flash)
name: factory image (ARK 4IN1 + G431 CAN)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -101,17 +103,52 @@ jobs:
- name: Install Arm toolchain
uses: ./.github/actions/setup-arm-sdk

- name: Build + verify factory full-flash image
- name: Build + verify factory full-flash images
run: make factory-image-check -j$(nproc)

- name: Upload factory artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: ark-4in1-factory-image
name: ark-factory-images
path: |
obj/ARK32_ARK_4IN1_F051_*.factory.bin
obj/ARK32_ARK_4IN1_F051_*.factory.img
obj/ARK32_ARK_4IN1_F051_*.factory.hex
obj/ARK32_ARK_4IN1_F051_*.eeprom.bin
obj/ARK32_ARK_G431_CAN_*.factory.img
obj/ARK32_ARK_G431_CAN_*.factory.hex
obj/ARK32_ARK_G431_CAN_*.eeprom.bin
obj/*.uavcan.bin
if-no-files-found: error
retention-days: 30

# Keep ARK_G431_CAN building under LTO so shared control-path PRs cannot
# silently break the 12S CAN target (no size gate yet — flash is ample).
build-ark-g431-can:
name: build ARK_G431_CAN
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Install Arm toolchain
run: |
make arm_sdk_install
make arm_sdk_check

- name: Build ARK_G431_CAN
run: make ARK_G431_CAN -j$(nproc)

- name: Upload G431 CAN binary
if: always()
uses: actions/upload-artifact@v4
with:
name: ark-g431-can
path: |
obj/ARK32_ARK_G431_CAN_*.elf
obj/ARK32_ARK_G431_CAN_*.bin
obj/ARK32_ARK_G431_CAN_*.hex
obj/*.uavcan.bin
if-no-files-found: ignore
retention-days: 14
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
obj/
bootloader/obj/
downloads/
tools/
.vscode
Expand Down
Binary file not shown.
63 changes: 53 additions & 10 deletions Bootloaders/README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
# Bootloader images

Prebuilt **[ARK32-bootloader](https://github.com/ARK-Electronics/ARK32-bootloader)** binaries, committed so the app can embed one and rewrite the bootloader region at boot (see `Src/bootloader_update.c`).
Prebuilt **[ARK32-bootloader](https://github.com/ARK-Electronics/ARK32-bootloader)** binaries, committed so:

[ARK32-bootloader](https://github.com/ARK-Electronics/ARK32-bootloader) is ARK’s fork of [upstream AM32-bootloader](https://github.com/am32-firmware/AM32-bootloader). For ARK hardware (ARK 4IN1 and related), always take images from **ARK32-bootloader releases**, not from the upstream bootloader repo alone.
1. **F051 (ARK 4IN1):** the app embeds one and rewrites the bootloader region at boot (see `Src/bootloader_update.c`).
2. **G431 CAN (ARK 12S CAN):** the app always embeds one (including `HWCI_PERF=1`) and rewrites the on-chip BL if it differs — so a manual or PX4 app-only flash still lands UAVCAN hw 0.71. `make factory-image-g431-can` also places the same image at `0x08000000` for blank-chip programming.

These files are release artifacts converted from the published Intel HEX to a flat binary and checked in. They are stored as `.bin` rather than a C array so the bytes stay comparable against a release asset (a hex dump in a header cannot).
[ARK32-bootloader](https://github.com/ARK-Electronics/ARK32-bootloader) is ARK’s fork of [upstream AM32-bootloader](https://github.com/am32-firmware/AM32-bootloader). For ARK hardware, always take images from **ARK32-bootloader**, not from the upstream bootloader repo alone.

These files are release (or branch) artifacts as flat binaries. They are stored as `.bin` rather than a C array so the bytes stay comparable against a build or release asset (a hex dump in a header cannot).

| File | Target | Signal pin | Source |
|---|---|---|---|
| `AM32_F051_BOOTLOADER_ARK4IN1_V18.bin` | STM32F051, ARK 4IN1 (default embed) | PB4; **PA15 nSLEEP low** | [ARK32-bootloader](https://github.com/ARK-Electronics/ARK32-bootloader) `master` (`cdce0a2`, #4); product `AM32_F051_BOOTLOADER_ARK4IN1` |
| `AM32_F051_BOOTLOADER_PB4_V18.bin` | STM32F051 generic PB4 (reference only) | PB4 | [ARK32-bootloader v18.0.0](https://github.com/ARK-Electronics/ARK32-bootloader/releases/tag/v18.0.0) (`0d667c5`), asset `AM32_F051_BOOTLOADER_PB4_V18.hex` |
| `AM32_G431_BOOTLOADER_ARKG4_CAN_V18.bin` | STM32G431/G491, ARK 12S CAN ESC (`ARK_G431_CAN`) | PB4 (also FDCAN TX PB9 / RX PA11); **DRV ENABLE (PC9) held low** | **In-tree** [`bootloader/`](../bootloader/) (`make bootloader-g431-can`). From ARK32-bootloader `feat/ark-g431-can-dual-protocol` (`060c417`, UAVCAN hw **0.71**) plus CAN FD. |

| Resource | URL |
|---|---|
Expand All @@ -19,20 +23,37 @@ These files are release artifacts converted from the published Intel HEX to a fl

`.gitignore` ignores `*.bin` repo-wide; this directory is un-ignored explicitly.

## How the image is used
## How the images are used

### F051 app-side embed

`Src/bl_image.S` pulls the file in with `.incbin` and pads it to the bootloader region size with `0xFF`. The linker script places it in a dedicated `.bl_image` section and asserts that it is exactly the region size and that it does not live inside the region it will erase.

The image is linked for **all F051 targets by default**, including `HWCI_PERF=1`
(LTO leaves enough flash for the image and the perf struct). To strip it for a
size emergency or pure perf A/B:
**F051** embeds on release builds by default. `HWCI_PERF=1` does **not** embed it (flash goes to the perf struct; the HWCI rig already has a bootloader on-chip).

**G431 CAN** always embeds (16 KiB region, including `HWCI_PERF=1`). First app boot rewrites `0x08000000..0x08003FFF` if the on-chip BL differs.

To strip the embed:

```bash
make ARK_4IN1_F051 EMBED_BOOTLOADER=0
make ARK_4IN1_F051 HWCI_PERF=1 NO_EMBED_BL=1
make ARK_G431_CAN NO_EMBED_BL=1
```

Either kill switch disables embed (`EMBED_BOOTLOADER=0` or `NO_EMBED_BL=1`).
`HWCI_PERF=1` also disables embed automatically on F051 only.

### G431 CAN factory image

`BL_IMAGE_G431_CAN` in the `Makefile` points at `AM32_G431_BOOTLOADER_ARKG4_CAN_V18.bin`. The same file is app-side embedded (above) and consumed by:

```bash
make factory-image-g431-can
# or
make factory-image-check
```

The factory builder places it at `0x08000000` (16 KiB region) and pads with `0xFF` to the app base at `0x08004000`. See [factory/README.md](../factory/README.md).

## Risk / recovery

Expand All @@ -45,6 +66,8 @@ App-side BL rewrite erases flash pages at `0x08000000` (reset vectors and the on

## Updating

### F051

1. Build or download the ARK 4IN1 product from [ARK32-bootloader](https://github.com/ARK-Electronics/ARK32-bootloader) (`make AM32_F051_BOOTLOADER_ARK4IN1`), or convert a release `.hex` with the pinned toolchain.
2. Install the flat binary:

Expand All @@ -59,7 +82,20 @@ App-side BL rewrite erases flash pages at `0x08000000` (reset vectors and the on

3. Point `BL_IMAGE_F051` in the `Makefile` at the new path if the filename changed (default is already the ARK4IN1 blob).
4. Update the table above with the release tag / source commit.
5. Rebuild — the `.bin` is an explicit prerequisite of the `.elf`, so the change is picked up.
5. Rebuild — the `.bin` is an explicit prerequisite of the F051 `.elf`, so the change is picked up.

### G431 CAN

Source of truth is [`bootloader/`](../bootloader/), not a separate checkout:

```sh
make bootloader-g431-can
# installs Bootloaders/AM32_G431_BOOTLOADER_ARKG4_CAN_V18.bin
make ARK_G431_CAN
make factory-image-g431-can
```

`make ARK_G431_CAN` rebuilds the image when `bootloader/` sources change. Point `BL_IMAGE_G431_CAN` in the `Makefile` at the new path only if the filename changed.

**Do not embed the generic `…_PB4` image on ARK 4IN1** if the chip has ARK4IN1 BL: first boot would rewrite PA15 nSLEEP-off back to stock.

Expand All @@ -76,4 +112,11 @@ cmp -n "$(wc -c < Bootloaders/AM32_F051_BOOTLOADER_ARK4IN1_V18.bin)" \
/tmp/embedded.bin Bootloaders/AM32_F051_BOOTLOADER_ARK4IN1_V18.bin
```

The compare is limited to the source file's length because `.bl_image` is padded out to the full 4096-byte region with `0xFF`.
The compare is limited to the source file's length because `.bl_image` is padded out to the full region (F051 4096, G431 CAN 16384) with `0xFF`. For G431:

```sh
arm-none-eabi-objcopy -O binary --only-section=.bl_image \
obj/AM32_ARK_G431_CAN_*.elf /tmp/embedded.bin
cmp -n "$(wc -c < Bootloaders/AM32_G431_BOOTLOADER_ARKG4_CAN_V18.bin)" \
/tmp/embedded.bin Bootloaders/AM32_G431_BOOTLOADER_ARKG4_CAN_V18.bin
```
3 changes: 2 additions & 1 deletion Inc/bootloader_update.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
/*
* Optionally rewrite the AM32 bootloader from an image embedded in the app.
* No-op when EMBED_BOOTLOADER is not defined (e.g. EMBED_BOOTLOADER=0 /
* NO_EMBED_BL=1 kill switches).
* NO_EMBED_BL=1 kill switches, or F051 HWCI_PERF=1). G431 CAN embeds
* by default including HWCI so a field app flash still refreshes the BL.
*
* Call once early after clocks/flash are usable and before motors run.
* Arms IWDG only when an update is about to run. Calls NVIC_SystemReset()
Expand Down
7 changes: 6 additions & 1 deletion Inc/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,12 @@ typedef struct fastPID {
} fastPID;

/*
input signal types
* input signal types (eeprom input_type / DroneCAN INPUT_SIGNAL_TYPE)
*
* AUTO_IN: detect first wire protocol (DShot or PWM). DroneCAN may run in
* parallel; while a RawCommand stream is live it owns throttle, otherwise
* the detected wire input is used.
* DRONECAN_IN: exclusive CAN — DShot/PWM capture IRQs disabled at init.
*/
enum inputType {
AUTO_IN = 0,
Expand Down
62 changes: 62 additions & 0 deletions Inc/debug_uart.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/*
* debug_uart.h — ARK 12S CAN debug console (USART2 TX on PB3 AF7 @ 115200)
*
* Same pinout as AM32-bootloader#60 / ARK bootloader USE_DEBUG_UART.
* App uses polled TX (not DMA1 CH1 — that is the DShot capture channel).
*
* Opt in with USE_DEBUG_UART on the target (ARK_G431_CAN).
*
* ISR-safe path: debugUartLog*() queues events; debugUartService() drains
* them from the main loop with blocking UART writes.
*/
#ifndef DEBUG_UART_H_
#define DEBUG_UART_H_

#include <stdint.h>
#include "targets.h"

/* Event codes for debugUartLogEvent() — always defined so call sites compile
* on targets without USE_DEBUG_UART (stubs are no-ops). */
enum {
DBG_EVT_BOOT = 1,
DBG_EVT_NFAULT, /* gate-driver nFAULT, unclassified (GDF etc.) */
DBG_EVT_NFAULT_UVLO, /* nFAULT + low bus → undervoltage class */
DBG_EVT_NFAULT_OCP, /* nFAULT + high current/drive → overcurrent class */
DBG_EVT_NFAULT_OTW, /* nFAULT + high temp → overtemperature class */
DBG_EVT_STUCK,
DBG_EVT_LVC,
DBG_EVT_SIGNAL,
DBG_EVT_DESYNC,
DBG_EVT_ACQ_DESYNC,
DBG_EVT_STALL,
DBG_EVT_GD_WAKE,
DBG_EVT_GD_SLEEP,
};

#ifdef USE_DEBUG_UART

void debugUartInit(void);
/* Blocking print (main / init only — not from ISRs). */
void debugUartPrint(const char *msg);
void debugUartPrintf(const char *fmt, ...);
/* Queue a state transition (ISR-safe). */
void debugUartLogState(uint8_t from, uint8_t to);
/* Queue a named event (ISR-safe). */
void debugUartLogEvent(uint8_t event);
/* Drain the queue — call once per main-loop tick. */
void debugUartService(void);

#else /* !USE_DEBUG_UART */

/* Macros (not empty inlines): format-string args are not evaluated and
* do not land in F051 .rodata when the target has no debug UART. */
# define debugUartInit() ((void)0)
# define debugUartPrint(msg) ((void)0)
# define debugUartPrintf(...) ((void)0)
# define debugUartLogState(from, to) ((void)0)
# define debugUartLogEvent(event) ((void)0)
# define debugUartService() ((void)0)

#endif /* USE_DEBUG_UART */

#endif /* DEBUG_UART_H_ */
12 changes: 11 additions & 1 deletion Inc/eeprom.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,17 @@ typedef union EEprom_u {
uint8_t filter_hz; // 181
uint8_t debug_rate; // 182
uint8_t term_enable; // 183
uint8_t reserved[8]; // 184-191
/* Width in C of the thermal foldback ramp below full
* derate; the onset is limits.temperature. Lives in the
* can block because that is where the free bytes are -
* the limiter itself is target-agnostic, and 0xFF on a
* board that never wrote this page is coerced in
* settings.c. */
uint8_t temp_derate_band; // 184
/* CAN FD data-phase bitrate in Mbps: 0 = auto-match
* the host (1/2/4/5), 1/2/4/5 = pinned. Byte 185. */
uint8_t fd_mbps; // 185
uint8_t reserved[6]; // 186-191
} can;
};
uint8_t buffer[192];
Expand Down
2 changes: 2 additions & 0 deletions Inc/esc_state.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ extern volatile esc_state_t esc_state;
/* Saturating count of named transitions that violated the edge table. */
extern volatile uint16_t esc_illegal_edge_count;

#ifdef USE_DEBUG_UART
const char *escStateName(esc_state_t s);
#endif
esc_state_t escGetState(void);

/* --- predicates (flag-backed; ISR may update flags before reconcile) --- */
Expand Down
Loading
Loading