syntax sugar

This commit is contained in:
iceman1001 2017-02-19 01:34:45 +01:00
commit 5e9d59fe2a
3 changed files with 15 additions and 15 deletions

View file

@ -1757,9 +1757,7 @@ int CmdFDXBdemodBI(const char *Cmd){
//attempt to psk1 demod graph buffer
int PSKDemod(const char *Cmd, bool verbose)
{
int invert=0;
int clk=0;
int maxErr=100;
int invert = 0, clk = 0, maxErr = 100;
sscanf(Cmd, "%i %i %i", &clk, &invert, &maxErr);
if (clk==1){
invert=1;
@ -1772,14 +1770,15 @@ int PSKDemod(const char *Cmd, bool verbose)
uint8_t BitStream[MAX_GRAPH_TRACE_LEN] = {0};
size_t BitLen = getFromGraphBuf(BitStream);
if (BitLen==0) return 0;
uint8_t carrier = countFC(BitStream, BitLen, 0);
if (carrier!=2 && carrier!=4 && carrier!=8){
//invalid carrier
return 0;
}
if (g_debugMode){
PrintAndLog("Carrier: rf/%d",carrier);
}
if (g_debugMode) PrintAndLog("Carrier: rf/%d",carrier);
int errCnt=0;
errCnt = pskRawDemod(BitStream, &BitLen, &clk, &invert);
if (errCnt > maxErr){

View file

@ -774,9 +774,9 @@ int CmdEM4x05Dump(const char *Cmd) {
// for now use default input of 1 as invalid (unlikely 1 will be a valid password...)
pwd = param_get32ex(Cmd, 0, 1, 16);
if ( pwd != 1 ) {
if ( pwd != 1 )
usePwd = true;
}
int success = 1;
for (; addr < 16; addr++) {
if (addr == 2) {
@ -792,7 +792,7 @@ int CmdEM4x05Dump(const char *Cmd) {
return success;
}
//ICEMAN; mentalnote to self: -1 is not doable for uint32_t..
int CmdEM4x05Read(const char *Cmd) {
int addr, pwd;
bool usePwd = false;

View file

@ -615,6 +615,7 @@ bool tryDetectModulation(){
tests[hits].ST = FALSE;
++hits;
}
//ICEMAN: are these PSKDemod calls needed?
// PSK2 - needs a call to psk1TOpsk2.
if ( PSKDemod("0 0 6", FALSE)) {
psk1TOpsk2(DemodBuffer, DemodBufferLen);