chg: 'lf t55xx config' - can set config based on a block0, offset and Q5

lf t55xx config c 000880E0 o 10     - sets a T55x7 w offset 10
lf t55xx config c 000880E0 o 6 Q5   - sets a Q5/T5555 w offset 6
This commit is contained in:
iceman1001 2019-09-16 12:36:04 +02:00
parent 88cbf789a1
commit 412f016b94
2 changed files with 7 additions and 8 deletions

View file

@ -519,6 +519,9 @@ void printT5xxHeader(uint8_t page) {
}
void SetConfigWithBlock0(uint32_t block0) {
SetConfigWithBlock0Ex(block0, 0, false);
}
void SetConfigWithBlock0Ex(uint32_t block0, uint8_t offset, bool Q5) {
// T55x7
uint32_t extend = (block0 >> (32 - 15)) & 0x01;
uint32_t dbr;
@ -541,10 +544,10 @@ void SetConfigWithBlock0(uint32_t block0) {
else
config.inverted = inv;
config.Q5 = 0;
config.Q5 = Q5;
config.ST = sst;
config.usepwd = pwd;
config.offset = 0;
config.offset = offset;
config.block0 = block0;
}
@ -677,12 +680,7 @@ static int CmdT55xxSetConfig(const char *Cmd) {
if (errors) return usage_t55xx_config();
if ( gotconf ) {
// Q5 - to be implemented
// T55x7
SetConfigWithBlock0(block0);
SetConfigWithBlock0Ex(block0, config.offset, config.Q5);
} else {
config.block0 = 0;
}

View file

@ -132,6 +132,7 @@ void Set_t55xx_Config(t55xx_conf_block_t conf);
int CmdLFT55XX(const char *Cmd);
void SetConfigWithBlock0(uint32_t block0);
void SetConfigWithBlock0Ex(uint32_t block0, uint8_t offset, bool Q5);
char *GetPskCfStr(uint32_t id, bool q5);
char *GetBitRateStr(uint32_t id, bool xmode);