chg: renaming a struct

This commit is contained in:
iceman1001 2019-07-27 21:15:43 +02:00
parent e99910694b
commit 283060f962
7 changed files with 55 additions and 55 deletions

View file

@ -3,7 +3,7 @@ All notable changes to this project will be documented in this file.
This project uses the changelog in accordance with [keepchangelog](http://keepachangelog.com/). Please use this to write notable changes, which is not the same as git commit log...
## [unreleased][unreleased]
- Add some more default keys (@ollibolli)
- Add some more default keys (ollibolli)
- Fix T55x7 Downlink timings backward compatible (@mwalker33)
- Add proper Makefile halting when using incompatible STANDALONE and PLATFORM vars (@doegox)
- Add T55x7 Downlink mode support (@mwalker33)

View file

@ -756,7 +756,7 @@ static void PacketReceived(PacketCommandNG *packet) {
break;
#ifdef WITH_LF
case CMD_SET_LF_T55XX_CONFIG: {
setT55xxConfig(packet->oldarg[0], (t55xx_config *) packet->data.asBytes);
setT55xxConfig(packet->oldarg[0], (t55xx_configurations_t*) packet->data.asBytes);
break;
}
case CMD_SET_LF_SAMPLING_CONFIG: {

View file

@ -116,8 +116,8 @@ void EM4xReadWord(uint8_t addr, uint32_t pwd, uint8_t usepwd);
void EM4xWriteWord(uint8_t addr, uint32_t data, uint32_t pwd, uint8_t usepwd);
void Cotag(uint32_t arg0);
void setT55xxConfig(uint8_t arg0, t55xx_config *c);
t55xx_config *getT55xxConfig(void);
void setT55xxConfig(uint8_t arg0, t55xx_configurations_t *c);
t55xx_configurations_t *getT55xxConfig(void);
void printT55xxConfig(void);
void loadT55xxConfig(void);

View file

@ -136,7 +136,7 @@ Initial values if not in flash
{ 31 , 20 , 18 , 40 , 0 , 0 , 15 }, // Leading 0
{ 29 , 17 , 15 , 31 , 47 , 63 , 15 } // 1 of 4
*/
t55xx_config T55xx_Timing = {
t55xx_configurations_t T55xx_Timing = {
{
{ 29 * 8, 17 * 8, 15 * 8, 47 * 8, 15 * 8, 0, 0 }, // Default Fixed
{ 31 * 8, 20 * 8, 18 * 8, 50 * 8, 15 * 8, 0, 0 }, // Long Leading Ref.
@ -210,7 +210,7 @@ void printT55xxConfig(void) {
}
}
void setT55xxConfig(uint8_t arg0, t55xx_config *c) {
void setT55xxConfig(uint8_t arg0, t55xx_configurations_t *c) {
for (uint8_t i = 0; i < 4; i++) {
if (c->m[i].start_gap != 0)
T55xx_Timing.m[i].start_gap = c->m[i].start_gap;
@ -278,7 +278,7 @@ void setT55xxConfig(uint8_t arg0, t55xx_config *c) {
#endif
}
t55xx_config *getT55xxConfig(void) {
t55xx_configurations_t *getT55xxConfig(void) {
return &T55xx_Timing;//_FixedBit;
}

View file

@ -2611,57 +2611,57 @@ static int CmdT55xxSetDeviceConfig(const char *Cmd) {
//Validations
if (errors || cmdp == 0) return usage_lf_deviceconfig();
t55xx_config conf = {{0}};
t55xx_configurations_t configurations = {0};
if (set_defaults) {
// fixed bit length
conf.m[T55XX_DLMODE_FIXED].start_gap = 29 * 8;
conf.m[T55XX_DLMODE_FIXED].write_gap = 17 * 8;
conf.m[T55XX_DLMODE_FIXED].write_0 = 15 * 8;
conf.m[T55XX_DLMODE_FIXED].write_1 = 47 * 8;
conf.m[T55XX_DLMODE_FIXED].read_gap = 15 * 8;
conf.m[T55XX_DLMODE_FIXED].write_2 = 0;
conf.m[T55XX_DLMODE_FIXED].write_3 = 0;
configurations.m[T55XX_DLMODE_FIXED].start_gap = 29 * 8;
configurations.m[T55XX_DLMODE_FIXED].write_gap = 17 * 8;
configurations.m[T55XX_DLMODE_FIXED].write_0 = 15 * 8;
configurations.m[T55XX_DLMODE_FIXED].write_1 = 47 * 8;
configurations.m[T55XX_DLMODE_FIXED].read_gap = 15 * 8;
configurations.m[T55XX_DLMODE_FIXED].write_2 = 0;
configurations.m[T55XX_DLMODE_FIXED].write_3 = 0;
// long leading reference
conf.m[T55XX_DLMODE_LLR].start_gap = 31 * 8;
conf.m[T55XX_DLMODE_LLR].write_gap = 20 * 8;
conf.m[T55XX_DLMODE_LLR].write_0 = 18 * 8;
conf.m[T55XX_DLMODE_LLR].write_1 = 50 * 8;
conf.m[T55XX_DLMODE_LLR].read_gap = 15 * 8;
conf.m[T55XX_DLMODE_LLR].write_2 = 0;
conf.m[T55XX_DLMODE_LLR].write_3 = 0;
configurations.m[T55XX_DLMODE_LLR].start_gap = 31 * 8;
configurations.m[T55XX_DLMODE_LLR].write_gap = 20 * 8;
configurations.m[T55XX_DLMODE_LLR].write_0 = 18 * 8;
configurations.m[T55XX_DLMODE_LLR].write_1 = 50 * 8;
configurations.m[T55XX_DLMODE_LLR].read_gap = 15 * 8;
configurations.m[T55XX_DLMODE_LLR].write_2 = 0;
configurations.m[T55XX_DLMODE_LLR].write_3 = 0;
// leading zero
conf.m[T55XX_DLMODE_LEADING_ZERO].start_gap = 31 * 8;
conf.m[T55XX_DLMODE_LEADING_ZERO].write_gap = 20 * 8;
conf.m[T55XX_DLMODE_LEADING_ZERO].write_0 = 18 * 8;
conf.m[T55XX_DLMODE_LEADING_ZERO].write_1 = 40 * 8;
conf.m[T55XX_DLMODE_LEADING_ZERO].read_gap = 15 * 8;
conf.m[T55XX_DLMODE_LEADING_ZERO].write_2 = 0;
conf.m[T55XX_DLMODE_LEADING_ZERO].write_3 = 0;
configurations.m[T55XX_DLMODE_LEADING_ZERO].start_gap = 31 * 8;
configurations.m[T55XX_DLMODE_LEADING_ZERO].write_gap = 20 * 8;
configurations.m[T55XX_DLMODE_LEADING_ZERO].write_0 = 18 * 8;
configurations.m[T55XX_DLMODE_LEADING_ZERO].write_1 = 40 * 8;
configurations.m[T55XX_DLMODE_LEADING_ZERO].read_gap = 15 * 8;
configurations.m[T55XX_DLMODE_LEADING_ZERO].write_2 = 0;
configurations.m[T55XX_DLMODE_LEADING_ZERO].write_3 = 0;
// 1 of 4 coding reference
conf.m[T55XX_DLMODE_1OF4].start_gap = 29 * 8;
conf.m[T55XX_DLMODE_1OF4].write_gap = 17 * 8;
conf.m[T55XX_DLMODE_1OF4].write_0 = 15 * 8;
conf.m[T55XX_DLMODE_1OF4].write_1 = 31 * 8;
conf.m[T55XX_DLMODE_1OF4].read_gap = 15 * 8;
conf.m[T55XX_DLMODE_1OF4].write_2 = 47 * 8;
conf.m[T55XX_DLMODE_1OF4].write_3 = 63 * 8;
configurations.m[T55XX_DLMODE_1OF4].start_gap = 29 * 8;
configurations.m[T55XX_DLMODE_1OF4].write_gap = 17 * 8;
configurations.m[T55XX_DLMODE_1OF4].write_0 = 15 * 8;
configurations.m[T55XX_DLMODE_1OF4].write_1 = 31 * 8;
configurations.m[T55XX_DLMODE_1OF4].read_gap = 15 * 8;
configurations.m[T55XX_DLMODE_1OF4].write_2 = 47 * 8;
configurations.m[T55XX_DLMODE_1OF4].write_3 = 63 * 8;
} else {
conf.m[downlink_mode].start_gap = startgap * 8;
conf.m[downlink_mode].write_gap = writegap * 8;
conf.m[downlink_mode].write_0 = write0 * 8;
conf.m[downlink_mode].write_1 = write1 * 8;
conf.m[downlink_mode].read_gap = readgap * 8;
conf.m[downlink_mode].write_2 = write2 * 8;
conf.m[downlink_mode].write_3 = write3 * 8;
configurations.m[downlink_mode].start_gap = startgap * 8;
configurations.m[downlink_mode].write_gap = writegap * 8;
configurations.m[downlink_mode].write_0 = write0 * 8;
configurations.m[downlink_mode].write_1 = write1 * 8;
configurations.m[downlink_mode].read_gap = readgap * 8;
configurations.m[downlink_mode].write_2 = write2 * 8;
configurations.m[downlink_mode].write_3 = write3 * 8;
}
clearCommandBuffer();
SendCommandOLD(CMD_SET_LF_T55XX_CONFIG, shall_persist, 0, 0, &conf, sizeof(t55xx_config));
SendCommandOLD(CMD_SET_LF_T55XX_CONFIG, shall_persist, 0, 0, &configurations, sizeof(t55xx_configurations_t));
return PM3_SUCCESS;
}

View file

@ -118,7 +118,7 @@ typedef struct {
bool averaging;
int divisor;
int trigger_threshold;
} sample_config;
} PACKED sample_config;
/*
typedef struct {
uint16_t start_gap;
@ -131,20 +131,20 @@ typedef struct {
// Extended to support 1 of 4 timing
typedef struct {
uint16_t start_gap ;
uint16_t write_gap ;
uint16_t write_0 ;
uint16_t write_1 ;
uint16_t read_gap ;
uint16_t write_2 ;
uint16_t write_3 ;
uint16_t start_gap;
uint16_t write_gap;
uint16_t write_0;
uint16_t write_1;
uint16_t read_gap;
uint16_t write_2;
uint16_t write_3;
} t55xx_config_t;
// This setup will allow for the 4 downlink modes "m" as well as other items if needed.
// Given the one struct we can then read/write to flash/client in one go.
typedef struct {
t55xx_config_t m[4]; // mode
} t55xx_config;
} t55xx_configurations_t;
/*typedef struct {
uint16_t start_gap [4];

View file

@ -61,7 +61,7 @@ extern uint32_t FLASHMEM_SPIBAUDRATE;
#endif
#ifndef T55XX_CONFIG_LEN
# define T55XX_CONFIG_LEN sizeof( t55xx_config )
# define T55XX_CONFIG_LEN sizeof( t55xx_configurations_t )
#endif
#ifndef T55XX_CONFIG_OFFSET