Add py test and fix work with float in FLASH
This commit is contained in:
parent
a0800410e0
commit
0980243848
4 changed files with 136 additions and 16 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue