SystemK v02.00 #8
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "SystemK_interface_improvements"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
SystemK v02.00
Summary
Updates the 2020TPC platform to SystemK v02.00, which introduces a set of HAL interface improvements documented in SystemK PR #15 and
SystemK/INTERFACE_IMPROVEMENTS.md. All platform implementation files are updated to match the new interfaces. Changes are applied identically to both2020TPCApp1.cydsnand2020TPCAppNoDFU.cydsn.Changes
SystemK submodule (
2020TPCApp1.cydsn/SystemK,2020TPCAppNoDFU.cydsn/SystemK)Updated from v01.01 to v02.00. Key interface changes in the new SystemK:
BLE_Init()toBLE_HW_Interface.hSETTINGS_Load()toSettings_Interface.hBLE_Quiet/BLE_Unquietsemantics inBLE_HW_Interface.hHW_Execute_Console_Commandparameter changed fromconst uint8_t *toconst char *BLE_GetMyAddressparameter tightened touint8_t BD_ADDR[BD_ADDR_SIZE]SETTINGS_get_device_namegains amax_lenparameterHW_NeoPixels_Get_My_Color()removed from the HALHW_NeoPixels_Set_RGB()replaced byHW_NeoPixels_Set_Color(color_t)AudioAction_T.Datachanged fromvoid *to typedAudioActionData_TunionPrepare_Tag/Send_Tagnow accept explicit packet/handle argumentsSETTINGS_get/set_uint8_t/uint32_treplaced by per-setting typed accessorsREADME.mdUpdated the SystemK version number in the dependency table from
1.0to02.00.NVM/NVM_Settings.c(Phase 1.2, 2.3, 4.3)SETTINGS_get_uint8_t,SETTINGS_set_uint8_t,SETTINGS_get_uint32_t, andSETTINGS_set_uint32_tfunctions with 20typed per-setting accessors matching the new
Settings_Interface.h:SETTINGS_get/set_Is_Right_Handed,_Audio_Volume,_Team_ID,_Player_ID,_Weapon_ID,_Max_Health,_N_Special_Weapons_On_Reentry,_T_Start_Game_in_ms,_T_Game_Length_in_ms,_Secondary_Color, and theread-only
SETTINGS_get_Device_Type.SETTINGS_Load(). On this platform, NVM is loaded asynchronouslyby the RTOS NVM task after the scheduler starts, so
SETTINGS_Load()returnsSYSTEMK_RESULT_SUCCESSimmediately.SETTINGS_get_device_nameto accept the newmax_lenparameterand pass it to
strncpy.HW/HW_NeoPixels.c(Phase 3.1, 3.2)HW_NeoPixels_Set_RGB(channel, position, r, g, b)toHW_NeoPixels_Set_Color(channel, position, color_t color). Gammacorrection (
Gamma8[]table lookup) and RGB component extraction now happeninside the HAL function rather than at every call site. The hardware
color-order (RGB / GRB) swapping that was previously done in
Single_Channel_Helpers.his handled here as before.NeoPixels_Set_Color_On_All_Channelshelper to callHW_NeoPixels_Set_Colordirectly (removing the manualGamma8[]expansion).HW_NeoPixels_Get_My_Color(). Team color is game logic, nothardware; the equivalent is now
GAME_Get_My_Color()defined inSystemK/Game/Game.h.Audio.c(Phase 4.1)*((uint8_t *)action.Data)pointer dereferences (in theAUDIO_SET_VOLUMEandAUDIO_PRONOUNCE_NUMBER_0_TO_100cases) to use thenew typed union member:
action.Data.number.COMM/BLE/COMM_BLE.c(Phase 1.1, 2.2)BLE_Init(), the new HAL entry point required byBLE_HW_Interface.h.It delegates to the existing internal
COMM_BLE_Init().BLE_GetMyAddresssignature fromuint8_t * BD_ADDRtouint8_t BD_ADDR[BD_ADDR_SIZE]to match the tightened interface declaration.COMM/BLE/COMM_BLE_UART.c(Phase 2.1)(const char8 * const)cast on the call toCOMM_Console_Execute_Internal_Commandto match the updatedconst char8 *parameter type.COMM/COMM_Console.candCOMM/COMM_Console.h(Phase 2.1)HW_Execute_Console_Commandparameter fromconst uint8_t * constto
const char * const, matching the correctedConsole_HW_Interface.h.COMM_Console_Execute_Internal_Command(andits declaration in
COMM_Console.h) fromconst uint8_t * consttoconst char8 * const.CONFIG/CONFIG_RTOS.c(Phase 1.1)COMM_BLE_Init()call fromCONFIG_InitTasks().BLE initialization is now triggered by
BLE_Init(), which is called fromInitialize_SystemK()inCONFIG_RunTasks(), making the initializationsequence explicit and under SystemK's control.
Fire_Control.c(Phase 4.2)Prepare_Tag()/Send_Tag()functions withthe new explicit-packet signatures:
PreparedTag_T *Prepare_Tag(const TagPacket_T *packet)— encodes thesupplied packet into a pulse train, sets the IR modulation frequency, stores
the result in a static
PreparedTag_T, and returns a pointer to it.SystemKResult_T Send_Tag(PreparedTag_T *tag)— initiates the pulse trainvia
tag->pulse_train.TagPacket_T Shot_Packetmodule-level variable (the packet isnow built by the caller via
GAME_Build_My_Tag_Packet()inGame.h).static PreparedTag_T Shot_Prepared_Tagto hold the platform'sencoded tag between
Prepare_TagandSend_Tagcalls.COMM/ConsoleCommands/COMM_STATE_ConsoleCommands.c(Phase 4.2)event tagandevent tag <n>console commands to use thenew two-step IR API:
Prepare_Tag(GAME_Build_My_Tag_Packet())is called once(per command invocation) to build and encode the current tag packet, and
Send_Tag(prepared)is called once per shot.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.