mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 13:53:55 -07:00
Add hw tia
to trigger a new Timing Interval Acquisition
This commit is contained in:
parent
c7d84ce239
commit
3fce47d023
8 changed files with 109 additions and 39 deletions
|
@ -11,6 +11,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
#include "appmain.h"
|
||||
|
||||
#include "clocks.h"
|
||||
#include "usb_cdc.h"
|
||||
#include "proxmark3_arm.h"
|
||||
#include "dbprint.h"
|
||||
|
@ -303,6 +304,14 @@ void SendVersion(void) {
|
|||
reply_ng(CMD_VERSION, PM3_SUCCESS, (uint8_t *)&payload, 12 + payload.versionstr_len);
|
||||
}
|
||||
|
||||
void TimingIntervalAcquisition(void) {
|
||||
// trigger new acquisition by turning main oscillator off and on
|
||||
mck_from_pll_to_slck();
|
||||
mck_from_slck_to_pll(false);
|
||||
// wait for MCFR and recompute RTMR scaler
|
||||
StartTickCount();
|
||||
}
|
||||
|
||||
// measure the Connection Speed by sending SpeedTestBufferSize bytes to client and measuring the elapsed time.
|
||||
// Note: this mimics GetFromBigbuf(), i.e. we have the overhead of the PacketCommandNG structure included.
|
||||
void printConnSpeed(void) {
|
||||
|
@ -1889,6 +1898,16 @@ static void PacketReceived(PacketCommandNG *packet) {
|
|||
SendStatus();
|
||||
break;
|
||||
}
|
||||
case CMD_TIA: {
|
||||
uint16_t mainf = AT91C_BASE_PMC->PMC_MCFR & AT91C_CKGR_MAINF;
|
||||
Dbprintf(" Slow clock old measured value:.........%d Hz", (16 * MAINCK) / mainf);
|
||||
TimingIntervalAcquisition();
|
||||
mainf = AT91C_BASE_PMC->PMC_MCFR & AT91C_CKGR_MAINF;
|
||||
Dbprintf(""); // first message gets lost
|
||||
Dbprintf(" Slow clock new measured value:.........%d Hz", (16 * MAINCK) / mainf);
|
||||
reply_ng(CMD_TIA, PM3_SUCCESS, NULL, 0);
|
||||
break;
|
||||
}
|
||||
case CMD_STANDALONE: {
|
||||
RunMod();
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue