Add py test and fix work with float in FLASH

This commit is contained in:
Valentin Dabstep 2025-05-15 23:13:07 +03:00
parent a0800410e0
commit 0980243848
4 changed files with 136 additions and 16 deletions

View file

@ -9,14 +9,14 @@
/* no padding for this struct, beacuse storing 8 bytes*/
typedef struct{
uint8_t data_id; // data_id = id register of can
uint8_t data_type; //float or uint8_t if 4 - float 1 - uint8_t
uint8_t data_type;
uint16_t crc;
uint32_t value;
// uint32_t write_ptr_now;
}FLASH_RECORD;
enum {
addr_id = 0,
pid_p,
pid_p = 1,
pid_i,
pid_d,
foc_id,
@ -24,6 +24,12 @@ enum {
vel
};
/* for saved in FLASH float data*/
union{
uint32_t i;
float f;
}conv_float_to_int;
#define FLASH_RECORD_SIZE sizeof(FLASH_RECORD) //size flash struct
#define PARAM_COUNT 4 // count data in flash