feat(i18n): full English translation of demo-epb
Validate / build-test (macos-latest) (push) Failing after 3s
Validate / build-test (windows-latest) (push) Failing after 15s
Validate / build-test (ubuntu-latest) (push) Successful in 17s
Validate / reports (push) Successful in 50s
Release / release (push) Successful in 50s
Validate / build-test (macos-latest) (push) Failing after 3s
Validate / build-test (windows-latest) (push) Failing after 15s
Validate / build-test (ubuntu-latest) (push) Successful in 17s
Validate / reports (push) Successful in 50s
Release / release (push) Successful in 50s
Phase 2 of the English translation: Word documents (filled, EPB-specific): - 8 plans (PID, PM, QA, SWE, Test, Project Manual, CM, RM) - 6 safety docs (HARA, Safety Case, FMEDA, MISRA Compliance, Verification Report, Tool Qualification Cppcheck) - 2 manuals (User, Service) - 3 audit artefacts (Review minutes, NC-001, MISRA-REC-001) - All regenerated via pandoc from English markdown sources Code, tests, headers: - All file headers, struct comments, function docstrings in English - All test names (TEST_BEGIN strings) translated - Inline comments translated - 46 tests still green after translation CI workflows: - All step names in English - Step descriptions, comments, release notes template in English README.md fully rewritten in English with proper guided tour. Phase 3 (still pending): dev-process repo templates + toolstack/setup docs.
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
|
||||
typedef struct {
|
||||
ActuatorStatus status;
|
||||
uint16_t over_ms; /* Millisekunden ueber Strom-Limit (zaehlt in 1 kHz ISR) */
|
||||
uint16_t over_ms; /* Milliseconds above current limit (counts in 1 kHz ISR) */
|
||||
} ActuatorCtx;
|
||||
|
||||
static ActuatorCtx s_ctx[ACTUATOR_COUNT];
|
||||
@@ -100,7 +100,7 @@ void actuator_isr_1khz(ActuatorId id, uint16_t current_sample_ma)
|
||||
s_ctx[id].status.peak_current_ma = current_sample_ma;
|
||||
}
|
||||
|
||||
/* SWE-014: Overcurrent-Cutoff bei > 8 A fuer > 100 ms */
|
||||
/* SWE-014: Overcurrent cutoff at > 8 A for > 100 ms */
|
||||
if (current_sample_ma > ACT_OVERCURRENT_LIMIT_MA) {
|
||||
if (s_ctx[id].over_ms < UINT16_MAX) {
|
||||
++s_ctx[id].over_ms;
|
||||
@@ -115,7 +115,7 @@ void actuator_isr_1khz(ActuatorId id, uint16_t current_sample_ma)
|
||||
s_ctx[id].over_ms = 0U;
|
||||
}
|
||||
|
||||
/* SWE-015: Klemmkraft aus Peak-Strom schaetzen (nur bei Apply). */
|
||||
/* SWE-015: Estimate clamping force from peak current (only on apply). */
|
||||
if (s_ctx[id].status.direction == ACT_DIR_APPLY) {
|
||||
const uint32_t force = ((uint32_t)s_ctx[id].status.peak_current_ma
|
||||
* ACT_FORCE_PER_AMP_N) / 1000U;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* @file actuator_driver.h
|
||||
* @brief Low-Level-Ansteuerung der EPB-Aktoren.
|
||||
* @brief Low-level control of the EPB actuators.
|
||||
*
|
||||
* @arch SWA-003
|
||||
* @reqs SWE-006 SWE-013 SWE-014 SWE-015
|
||||
@@ -21,14 +21,14 @@ typedef enum {
|
||||
typedef struct {
|
||||
ActuatorDirection direction;
|
||||
uint8_t pwm_percent; /* 0..100 */
|
||||
uint16_t current_ma; /* aktueller Motorstrom */
|
||||
uint16_t current_ma; /* current motor current */
|
||||
uint16_t peak_current_ma;
|
||||
uint16_t clamping_force_n; /* geschaetzt aus Strom */
|
||||
uint16_t clamping_force_n; /* estimated from current */
|
||||
bool overcurrent;
|
||||
EpbStatus last_error;
|
||||
} ActuatorStatus;
|
||||
|
||||
/** Strom-Limit (Spec) und Zeitfenster fuer Cutoff (Spec). */
|
||||
/** Current limit (spec) and time window for cutoff (spec). */
|
||||
#define ACT_OVERCURRENT_LIMIT_MA 8000U
|
||||
#define ACT_OVERCURRENT_WINDOW_MS 100U
|
||||
#define ACT_FORCE_PER_AMP_N 2500U /* lineare Naeherung */
|
||||
@@ -40,9 +40,9 @@ EpbStatus actuator_stop(ActuatorId id);
|
||||
ActuatorStatus actuator_get_status(ActuatorId id);
|
||||
|
||||
/**
|
||||
* @brief ISR-Hook fuer Strom-Sampling. Wird mit 1 kHz aufgerufen.
|
||||
* @brief ISR hook for current sampling. Called at 1 kHz.
|
||||
*
|
||||
* Fuer Tests durch Test-Doubles ersetzt.
|
||||
* Replaced by test doubles for testing.
|
||||
*/
|
||||
void actuator_isr_1khz(ActuatorId id, uint16_t current_sample_ma);
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
* @arch SWA-002
|
||||
* @reqs SWE-001 SWE-002 SWE-003 SWE-004
|
||||
*
|
||||
* ASIL: D. Diese Komponente ist die sicherheitskritische Kernlogik.
|
||||
* Aenderungen erfordern Technical Review mit 2 Approvals.
|
||||
* ASIL: D. This is the safety-critical core logic.
|
||||
* Changes require a technical review with 2 approvals.
|
||||
*/
|
||||
#include <stddef.h>
|
||||
|
||||
@@ -15,9 +15,9 @@
|
||||
|
||||
typedef struct {
|
||||
EpbState state;
|
||||
uint8_t step_in_state; /* 50ms-Ticks im aktuellen State */
|
||||
uint8_t step_in_state; /* 50ms ticks in the current state */
|
||||
EpbStatus last_error;
|
||||
uint32_t step_count; /* Watchdog-Alive-Counter */
|
||||
uint32_t step_count; /* Watchdog alive counter */
|
||||
} ApplyCtx;
|
||||
|
||||
static ApplyCtx s_ctx;
|
||||
@@ -30,7 +30,7 @@ static void enter_state(EpbState new_state)
|
||||
|
||||
static bool release_preconditions_ok(const ApplyInputs* in)
|
||||
{
|
||||
/* @reqs SWE-005 (Release-Voraussetzungen) — hier konsumiert */
|
||||
/* @reqs SWE-005 (Release preconditions) — consumed here */
|
||||
return in->engine_running
|
||||
&& in->brake_pedal_pressed
|
||||
&& in->gear_engaged;
|
||||
@@ -68,7 +68,7 @@ void apply_ctrl_step_50ms(const ApplyInputs* in)
|
||||
return;
|
||||
}
|
||||
|
||||
/* SWE-002: Watchdog-Alive-Counter erhoehen */
|
||||
/* SWE-002: Watchdog alive counter erhoehen */
|
||||
++s_ctx.step_count;
|
||||
|
||||
if (s_ctx.step_in_state < UINT8_MAX) {
|
||||
@@ -85,7 +85,7 @@ void apply_ctrl_step_50ms(const ApplyInputs* in)
|
||||
break;
|
||||
|
||||
case EPB_STATE_APPLYING:
|
||||
/* SWE-004: Klemmkraft-Erreichen pruefen */
|
||||
/* SWE-004: Check target clamping force reached */
|
||||
if (min_force(in) >= APPLY_TARGET_FORCE_N) {
|
||||
(void)actuator_stop(ACTUATOR_LEFT);
|
||||
(void)actuator_stop(ACTUATOR_RIGHT);
|
||||
@@ -99,7 +99,7 @@ void apply_ctrl_step_50ms(const ApplyInputs* in)
|
||||
break;
|
||||
|
||||
case EPB_STATE_APPLIED:
|
||||
/* SWE-001: Klemmkraft halten — bei Unterschreitung nachregeln */
|
||||
/* SWE-001: Hold clamping force — re-apply on drop */
|
||||
if (min_force(in) < (APPLY_TARGET_FORCE_N - HOLD_TOLERANCE_N)) {
|
||||
(void)actuator_apply(ACTUATOR_LEFT, 60U);
|
||||
(void)actuator_apply(ACTUATOR_RIGHT, 60U);
|
||||
@@ -128,7 +128,7 @@ void apply_ctrl_step_50ms(const ApplyInputs* in)
|
||||
|
||||
case EPB_STATE_ERROR:
|
||||
default:
|
||||
/* Auf Reset warten; sicherer Zustand ist Apply, also kein Release */
|
||||
/* Wait for reset; safe state is Apply, hence no release */
|
||||
if (!apply_request_present(in) && !release_request_present(in)) {
|
||||
s_ctx.last_error = EPB_OK;
|
||||
enter_state(EPB_STATE_RELEASED);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* @file apply_controller.h
|
||||
* @brief Apply/Hold/Release-Steuerung der EPB.
|
||||
* @brief Apply/Hold/Release control of the EPB.
|
||||
*
|
||||
* @arch SWA-002
|
||||
* @reqs SWE-001 SWE-002 SWE-003 SWE-004
|
||||
@@ -23,14 +23,14 @@ typedef struct {
|
||||
uint16_t right_force_n;
|
||||
} ApplyInputs;
|
||||
|
||||
#define APPLY_TARGET_FORCE_N 12000U /* Ziel-Klemmkraft je Aktor */
|
||||
#define APPLY_TARGET_FORCE_N 12000U /* Target clamping force per actuator */
|
||||
#define APPLY_TIMEOUT_50MS 30U /* 30 * 50ms = 1500 ms */
|
||||
#define HOLD_TOLERANCE_N 1200U /* 10% von Ziel */
|
||||
#define HOLD_TOLERANCE_N 1200U /* 10% of target */
|
||||
|
||||
EpbStatus apply_ctrl_init(void);
|
||||
|
||||
/**
|
||||
* @brief Step-Funktion 50 ms.
|
||||
* @brief 50 ms step function.
|
||||
*
|
||||
* @reqs SWE-001 SWE-002 SWE-003 SWE-004
|
||||
*/
|
||||
@@ -38,6 +38,6 @@ void apply_ctrl_step_50ms(const ApplyInputs* in);
|
||||
|
||||
EpbState apply_ctrl_get_state(void);
|
||||
EpbStatus apply_ctrl_last_error(void);
|
||||
uint32_t apply_ctrl_get_step_count(void); /* Watchdog-Alive-Counter */
|
||||
uint32_t apply_ctrl_get_step_count(void); /* Watchdog alive counter */
|
||||
|
||||
#endif /* APPLY_CONTROLLER_H */
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* @file epb_types.h
|
||||
* @brief Gemeinsame Typen fuer die EPB-Software.
|
||||
* @brief Common types for the EPB software.
|
||||
*
|
||||
* @arch SA-001
|
||||
*/
|
||||
|
||||
+18
-18
@@ -1,14 +1,14 @@
|
||||
/**
|
||||
* @file safety_manager.c
|
||||
* @brief Safety Manager — Hill-Hold, Auto-Apply, Drive-Away-Assist.
|
||||
* @brief Safety Manager — Hill-Hold, Auto-Apply, Drive-Away Assist.
|
||||
*
|
||||
* @arch SWA-001
|
||||
* @reqs SWE-007 SWE-008 SWE-009 SWE-010 SWE-011 SWE-012
|
||||
*
|
||||
* ASIL: D. Diese Komponente entscheidet, wann der Apply Controller eine
|
||||
* Apply- oder Release-Anforderung erhaelt (Hill-Hold-Uebergabe, Auto-Apply
|
||||
* bei Motor-Aus, Drive-Away-Assist).
|
||||
* Aenderungen erfordern Technical Review mit 2 Approvals.
|
||||
* ASIL: D. This component decides, when the Apply Controller receives an
|
||||
* apply or release request (hill-hold handover, auto-apply on
|
||||
* engine-off, drive-away assist).
|
||||
* Changes require a technical review with 2 approvals.
|
||||
*/
|
||||
#include <stddef.h>
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
typedef struct {
|
||||
SafetyState state;
|
||||
uint16_t ticks_in_state; /* 50ms-Ticks im aktuellen Zustand */
|
||||
uint16_t ticks_in_state; /* 50ms ticks in the current state */
|
||||
bool apply_requested;
|
||||
bool release_requested;
|
||||
} SafetyCtx;
|
||||
@@ -36,7 +36,7 @@ static bool standstill(const SafetyInputs* in)
|
||||
|
||||
static bool grade_steep(const SafetyInputs* in)
|
||||
{
|
||||
/* @reqs SWE-009: Hill-Hold ab |grade| > 5% */
|
||||
/* @reqs SWE-009: Hill-hold above |grade| > 5% */
|
||||
float g = in->grade_percent;
|
||||
if (g < 0.0f) {
|
||||
g = -g;
|
||||
@@ -45,7 +45,7 @@ static bool grade_steep(const SafetyInputs* in)
|
||||
}
|
||||
|
||||
/**
|
||||
* @reqs SWE-011 (Anfahrabsicht erkennen)
|
||||
* @reqs SWE-011 (Detect drive-away intent)
|
||||
*/
|
||||
static bool drive_intent(const SafetyInputs* in)
|
||||
{
|
||||
@@ -55,7 +55,7 @@ static bool drive_intent(const SafetyInputs* in)
|
||||
}
|
||||
|
||||
/**
|
||||
* @reqs SWE-012 (Sicherheits-Check vor Auto-Release)
|
||||
* @reqs SWE-012 (Safety check before auto-release)
|
||||
*/
|
||||
static bool drive_away_safety_ok(const SafetyInputs* in)
|
||||
{
|
||||
@@ -87,19 +87,19 @@ void safety_mgr_step_50ms(const SafetyInputs* in)
|
||||
|
||||
switch (s_ctx.state) {
|
||||
case SAFETY_IDLE:
|
||||
/* @reqs SWE-009: Hill-Hold-Aktivierung */
|
||||
/* @reqs SWE-009: Hill-hold activation */
|
||||
if (grade_steep(in) && standstill(in) && in->brake_pedal_pressed) {
|
||||
enter(SAFETY_HILL_HOLD_ARMED);
|
||||
break;
|
||||
}
|
||||
/* @reqs SWE-007: Motor-Aus-Bedingung erkennen */
|
||||
/* @reqs SWE-007: Detect engine-off condition */
|
||||
if (!in->engine_running && standstill(in)
|
||||
&& in->current_state != EPB_STATE_APPLIED
|
||||
&& in->current_state != EPB_STATE_APPLYING) {
|
||||
enter(SAFETY_AUTO_APPLY_ARMED);
|
||||
break;
|
||||
}
|
||||
/* @reqs SWE-011 + SWE-012: Drive-Away-Assist */
|
||||
/* @reqs SWE-011 + SWE-012: Drive-Away Assist */
|
||||
if (in->current_state == EPB_STATE_APPLIED
|
||||
&& drive_intent(in) && drive_away_safety_ok(in)) {
|
||||
s_ctx.release_requested = true;
|
||||
@@ -108,20 +108,20 @@ void safety_mgr_step_50ms(const SafetyInputs* in)
|
||||
break;
|
||||
|
||||
case SAFETY_HILL_HOLD_ARMED:
|
||||
/* @reqs SWE-010: Beim Loslassen des Bremspedals Apply triggern */
|
||||
/* @reqs SWE-010: Trigger apply on brake release */
|
||||
if (!in->brake_pedal_pressed) {
|
||||
s_ctx.apply_requested = true;
|
||||
enter(SAFETY_HILL_HOLD_ACTIVE);
|
||||
break;
|
||||
}
|
||||
/* Bedingung fuer Hill-Hold nicht mehr erfuellt? */
|
||||
/* Hill-hold condition no longer met? */
|
||||
if (!grade_steep(in) || !standstill(in)) {
|
||||
enter(SAFETY_IDLE);
|
||||
}
|
||||
break;
|
||||
|
||||
case SAFETY_HILL_HOLD_ACTIVE:
|
||||
/* Beendet, wenn Fahrzeug rollt oder Bremse appliziert */
|
||||
/* Ends when vehicle rolls or brake is applied */
|
||||
if (in->vehicle_speed_kmh > SAFETY_RELEASE_KMH
|
||||
|| in->current_state == EPB_STATE_APPLIED) {
|
||||
enter(SAFETY_IDLE);
|
||||
@@ -131,12 +131,12 @@ void safety_mgr_step_50ms(const SafetyInputs* in)
|
||||
break;
|
||||
|
||||
case SAFETY_AUTO_APPLY_ARMED:
|
||||
/* Bedingung muss durchgaengig erfuellt sein */
|
||||
/* Condition must remain continuously satisfied */
|
||||
if (in->engine_running || !standstill(in)) {
|
||||
enter(SAFETY_IDLE);
|
||||
break;
|
||||
}
|
||||
/* @reqs SWE-008: Auto-Apply nach 2 s (40 Ticks) Verzoegerung */
|
||||
/* @reqs SWE-008: Auto-apply after 2 s (40 ticks) delay */
|
||||
if (s_ctx.ticks_in_state >= SAFETY_AUTO_APPLY_DELAY_50MS) {
|
||||
s_ctx.apply_requested = true;
|
||||
enter(SAFETY_AUTO_APPLY_TRIGGERED);
|
||||
@@ -152,7 +152,7 @@ void safety_mgr_step_50ms(const SafetyInputs* in)
|
||||
break;
|
||||
|
||||
case SAFETY_DRIVE_AWAY:
|
||||
/* Beendet, wenn die Bremse geloest wurde oder Vorbedingungen nicht mehr ok. */
|
||||
/* Ends when the brake has been released or preconditions are no longer ok. */
|
||||
if (in->current_state == EPB_STATE_RELEASED
|
||||
|| in->current_state == EPB_STATE_RELEASING) {
|
||||
enter(SAFETY_IDLE);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* @file safety_manager.h
|
||||
* @brief Safety Manager — Hill-Hold, Auto-Apply, Drive-Away-Assist.
|
||||
* @brief Safety Manager — hill-hold, auto-apply, drive-away assist.
|
||||
*
|
||||
* @arch SWA-001
|
||||
* @reqs SWE-007 SWE-008 SWE-009 SWE-010 SWE-011 SWE-012
|
||||
@@ -38,25 +38,25 @@ typedef struct {
|
||||
bool brake_pedal_pressed;
|
||||
float vehicle_speed_kmh;
|
||||
float grade_percent;
|
||||
EpbState current_state; /* aus Apply Controller */
|
||||
/* Drive-Away-Assist Inputs (SWE-011, SWE-012) */
|
||||
EpbState current_state; /* from Apply Controller */
|
||||
/* Drive-Away Assist Inputs (SWE-011, SWE-012) */
|
||||
float gas_pedal_percent; /* 0..100 */
|
||||
bool gear_in_drive; /* Vorwaerts oder Rueckwaerts */
|
||||
bool door_closed; /* Fahrertuer */
|
||||
bool seatbelt_fastened; /* Fahrer-Gurt */
|
||||
bool gear_in_drive; /* forward or reverse */
|
||||
bool door_closed; /* driver door */
|
||||
bool seatbelt_fastened; /* driver seatbelt */
|
||||
} SafetyInputs;
|
||||
|
||||
/* Schwellwerte als Konstanten, damit Tests darauf zugreifen koennen. */
|
||||
/* Thresholds as constants, so tests can access them. */
|
||||
#define SAFETY_AUTO_APPLY_DELAY_50MS 40U /* 40 * 50ms = 2.0 s */
|
||||
#define SAFETY_STANDSTILL_KMH 0.5f
|
||||
#define SAFETY_RELEASE_KMH 2.0f
|
||||
#define SAFETY_HILLHOLD_GRADE_PCT 5.0f
|
||||
#define SAFETY_DRIVE_INTENT_GAS_PCT 10.0f /* Gaspedal > 10% = Anfahrabsicht */
|
||||
#define SAFETY_DRIVE_INTENT_GAS_PCT 10.0f /* Throttle > 10% = drive-away intent */
|
||||
|
||||
EpbStatus safety_mgr_init(void);
|
||||
void safety_mgr_step_50ms(const SafetyInputs* in);
|
||||
bool safety_mgr_apply_requested(void);
|
||||
bool safety_mgr_release_requested(void); /* Drive-Away-Assist */
|
||||
bool safety_mgr_release_requested(void); /* Drive-Away Assist */
|
||||
SafetyState safety_mgr_get_state(void);
|
||||
|
||||
#endif /* SAFETY_MANAGER_H */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* @file switch_debouncer.h
|
||||
* @brief EPB-Schalter mit Software-Entprellung.
|
||||
* @brief EPB switch with software debounce.
|
||||
*
|
||||
* @arch SWA-006
|
||||
* @reqs SWE-025
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
#include "epb_types.h"
|
||||
|
||||
/** Step-Zyklus 10 ms. Debounce-Schwelle 50 ms (5 stabile Samples). */
|
||||
/** Step cycle 10 ms. Debounce threshold 50 ms (5 stable samples). */
|
||||
#define SWITCH_DEBOUNCE_SAMPLES 5
|
||||
|
||||
EpbStatus switch_init(void);
|
||||
|
||||
Reference in New Issue
Block a user