mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-19 21:03:48 -07:00
chg: print stack fct and hfsniff
This commit is contained in:
parent
e1f0f89240
commit
da00cc0405
2 changed files with 23 additions and 8 deletions
|
@ -242,6 +242,16 @@ static uint32_t MeasureAntennaTuningLfData(void) {
|
||||||
return (MAX_ADC_LF_VOLTAGE * (SumAdc(ADC_CHAN_LF, 32) >> 1)) >> 14;
|
return (MAX_ADC_LF_VOLTAGE * (SumAdc(ADC_CHAN_LF, 32) >> 1)) >> 14;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void print_stack_usage(void) {
|
||||||
|
// pointer arithmetic is times 4. (two shifts to the left)
|
||||||
|
for (uint32_t *p = &_stack_start; ; ++p) {
|
||||||
|
if (*p != 0xdeadbeef) {
|
||||||
|
Dbprintf(" Max stack usage.........%d / %d bytes", (&_stack_end - p) << 2, (&_stack_end - &_stack_start) << 2);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void ReadMem(int addr) {
|
void ReadMem(int addr) {
|
||||||
const uint8_t *data = ((uint8_t *)addr);
|
const uint8_t *data = ((uint8_t *)addr);
|
||||||
|
|
||||||
|
@ -361,13 +371,9 @@ static void SendStatus(void) {
|
||||||
#endif
|
#endif
|
||||||
printConnSpeed();
|
printConnSpeed();
|
||||||
DbpString(_CYAN_("Various"));
|
DbpString(_CYAN_("Various"));
|
||||||
// pointer arithmetic is times 4. (two shifts to the left)
|
|
||||||
for (uint32_t *p = &_stack_start; ; ++p) {
|
print_stack_usage();
|
||||||
if (*p != 0xdeadbeef) {
|
|
||||||
Dbprintf(" Max stack usage.........%d / %d bytes", (&_stack_end - p) << 2, (&_stack_end - &_stack_start) << 2);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Dbprintf(" DBGLEVEL................%d", DBGLEVEL);
|
Dbprintf(" DBGLEVEL................%d", DBGLEVEL);
|
||||||
Dbprintf(" ToSendMax...............%d", ToSendMax);
|
Dbprintf(" ToSendMax...............%d", ToSendMax);
|
||||||
Dbprintf(" ToSendBit...............%d", ToSendBit);
|
Dbprintf(" ToSendBit...............%d", ToSendBit);
|
||||||
|
@ -1410,7 +1416,15 @@ static void PacketReceived(PacketCommandNG *packet) {
|
||||||
|
|
||||||
#ifdef WITH_HFSNIFF
|
#ifdef WITH_HFSNIFF
|
||||||
case CMD_HF_SNIFF: {
|
case CMD_HF_SNIFF: {
|
||||||
HfSniff(packet->oldarg[0], packet->oldarg[1]);
|
struct p {
|
||||||
|
uint32_t samplesToSkip;
|
||||||
|
uint32_t triggersToSkip;
|
||||||
|
} PACKED;
|
||||||
|
struct p *payload = (struct p *)packet->data.asBytes;
|
||||||
|
|
||||||
|
uint16_t len = 0;
|
||||||
|
int res = HfSniff(payload->samplesToSkip, payload->triggersToSkip, &len);
|
||||||
|
reply_ng(CMD_HF_SNIFF, res, (uint8_t *)&len, sizeof(len));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -39,5 +39,6 @@ void ToSendReset(void);
|
||||||
void ListenReaderField(uint8_t limit);
|
void ListenReaderField(uint8_t limit);
|
||||||
void StandAloneMode(void);
|
void StandAloneMode(void);
|
||||||
void printStandAloneModes(void);
|
void printStandAloneModes(void);
|
||||||
|
void print_stack_usage(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue