Build matching Carnival independent lateral and longitudinal firmware

This commit is contained in:
firestar5683
2026-11-03 11:12:56 -06:00
parent d42ddc3ac5
commit bf4e27fca5
41 changed files with 37 additions and 3 deletions
@@ -104,7 +104,7 @@ class GenericHDA2Startup(RadarHDA2Startup):
raise RuntimeError('Ordinary HDA-II startup does not admit this AOL configuration')
expected: Any = deepcopy(self.prepared_cp)
configs = expected.get('safetyConfigs', [])
allowed_words = (*tuple(word | 4 for word in STOCK_WORDS), 0x20B4) if long_aol else STOCK_WORDS
allowed_words = (*tuple(word | 4 for word in STOCK_WORDS), 0x20B4) if long_aol else (*STOCK_WORDS, 0x20B0)
if (len(configs) != 1 or configs[0]['safetyModel'] != 'hyundaiCanfd' or
configs[0]['safetyParam'] not in allowed_words or expected['alternativeExperience'] != 0):
raise RuntimeError('Ordinary HDA-II prepared stock profile cannot be finalized')
@@ -180,3 +180,36 @@ def test_actual_card_defers_carnival_until_initialized_and_then_native_rx(scenar
assert card.CP.to_dict() == original_cp
finally:
holder.close()
def test_refused_takeover_preserves_exact_stock_aol_and_sends_no_disable():
from opendbc.car.hyundai.ioniq6_handoff import TimestampedCanPacket
from opendbc.car.hyundai.generic_hda2_startup import GenericHDA2Startup
from opendbc.car.hyundai.canfd_stock_aol import qualified as stock_qualified
cp = params(CAR.KIA_CARNIVAL_2025, hda2=True, alt_buttons=True, alpha=True, adas=True, alt_lka=True)
now, tick, emitted = [100_000_000_000], [0], []
startup = None
def receive():
tick[0] += 1
now[0] += 10_000_000
return [TimestampedCanPacket(source_frames(startup.ci, tick[0]), now[0])]
with patch('time.clock_gettime_ns', side_effect=lambda clock: now[0]), \
patch('time.monotonic', side_effect=lambda: now[0] / 1e9), patch('time.sleep'):
startup = GenericHDA2Startup(cp, (receive, emitted.extend), clock=lambda: now[0] / 1e9, keeper_factory=Keeper)
prepared = startup.prepare_when_controls_ready(admission=lambda: False)
assert not prepared.openpilotLongitudinalControl and prepared.pcmCruise and not emitted
ci = CarInterface(prepared)
try:
startup.configure(ci)
assert startup.ready and ci.CS.out.canValid and startup.sources_current(ci, now[0])
ci.CP.safetyConfigs[0].safetyParam |= 0x800
assert ci.CP.safetyConfigs[0].safetyParam == 0x28B0 and stock_qualified(ci.CP, marked_only=True)
startup.finalize_aol_configuration(ci)
startup.seal_publication()
assert startup.prepared_for(ci.CP) and not emitted
assert startup.outcome is Outcome.STOCK_UNTOUCHED and startup.keeper is None
finally:
startup.close()
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -1,4 +1,4 @@
#pragma once
extern const uint8_t gitversion[29];
const uint8_t gitversion[29] = "DEV-507373cb-Pf38f504f-DEBUG";
const uint8_t gitversion[29] = "DEV-d42ddc3a-Pf38f504f-DEBUG";
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -1 +1 @@
DEV-507373cb-Pf38f504f-DEBUG
DEV-d42ddc3a-Pf38f504f-DEBUG
View File
+1
View File
@@ -0,0 +1 @@
{"protected_inventory_sha256": "c3181aba1c5e722d00cacb30fc4a200375ef0384963551cb571911bd68e57ff1", "schema_version": 1}