Pf calb table py
From DIDEAS Wiki
PF Users Navigation:
- PCB; Lifefix_users; Pf_users; benchtest_users; CalibFix Users; Hardware; Assembly ; iochan ;
- PCA : PCB ; AKENC SC/MC 218 ; FET 217 ; IMU219 ; Swifi ; Rev200_mods ; PCA Inventory
- Special Commands to the Ankle (PFCMD) : State Controller Commands; Motor Controller Commands; Python Examples; IMU Commands ;PFCMD_PY; Pf_calb_table_py; Virtual spring test; PF EEPROM
- DOC: Pf_users; Powerfoot Keyboard User Interface; Steps for Manual Tuning; "Dashboard" Program For Assisting with Tuning
- NEW (CEB) WIKI
- Torque Feedback Controller Guide
files to modify
- add eeprom address to eeprom_memmap.h
- could be else where, but helps us to keep track of what is being used where
- add macros to pyshared.c that list the global ram address, and or EEPROM address and virtual variable name
- to global.c, declare the global
- to global.h, define the global typedef
- latter two (global) files are optional, but help keep everything in one place
example
eeprom_memmap.h
#define PERSISTENT_DATA_C1_EEPROM_BASE_ADDRESS 0x1500 #define PERSISTENT_DATA_C2_EEPROM_BASE_ADDRESS 0x1580
... const SHARED_OBJECT_T SHARED_OBJECT[] = { ... SHARED_RAM_OBJ_M(PERSISTENT_DATA_T, persistent_data_c1), // use commas at EOL SHARED_RAM_OBJ_M(PERSISTENT_DATA_T, persistent_data_c2), SHARED_EE_OBJ_M (PERSISTENT_DATA_T, EE_persistent_data_c1, PERSISTENT_DATA_C1_EEPROM_BASE_ADDRESS), SHARED_EE_OBJ_M (PERSISTENT_DATA_T, EE_persistent_data_c2, PERSISTENT_DATA_C2_EEPROM_BASE_ADDRESS), ... } ;
global.h
typedef struct { UINT32_T crc; // this is the standard header, use CRC8 for now. UINT16_T version; UINT16_T length; UINT32_T magic; // "hash" for this typedef from the file pygen_shared_object_hash_codes.h ////////////////// UINT32_T count; } PERSISTENT_DATA_T; extern PERSISTENT_DATA_T persistent_data_c1; extern PERSISTENT_DATA_T persistent_data_c2;
global.c
PERSISTENT_DATA_T persistent_data_c1; PERSISTENT_DATA_T persistent_data_c2; void init_global(void) { ... ZERO_OBJ(persistent_data_c1); ZERO_OBJ(persistent_data_c2); ... }