mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-19 21:03:48 -07:00
chg: remove warnings on coverity
chg: encapsule flasmem function calls
This commit is contained in:
parent
df70619888
commit
02cc278e19
4 changed files with 18 additions and 20 deletions
|
@ -153,8 +153,7 @@ void SpinUp(uint32_t speed)
|
|||
LED_D_OFF();
|
||||
}
|
||||
|
||||
void TestFlashmemSpeed(size_t buffersize, uint32_t spibaudrate)
|
||||
{
|
||||
void TestFlashmemSpeed(size_t buffersize, uint32_t spibaudrate) {
|
||||
|
||||
FLASHMEM_SPIBAUDRATE = spibaudrate*1000000;
|
||||
DbprintfEx(FLAG_NOLOG, "%s---+----[ %s %s[%dKB] %s] (%d)", _GREEN_, _WHITE_, _YELLOW_, buffersize / 1024, _WHITE_, FLASHMEM_SPIBAUDRATE);
|
||||
|
@ -230,9 +229,7 @@ void TestFlashmemRoutine()
|
|||
return;
|
||||
}
|
||||
|
||||
void ReadLastTagFromFlash()
|
||||
{
|
||||
|
||||
void ReadLastTagFromFlash() {
|
||||
SpinOff(0);
|
||||
LED_A_ON();
|
||||
LED_B_ON();
|
||||
|
@ -248,8 +245,7 @@ void ReadLastTagFromFlash()
|
|||
size_t size = len;
|
||||
uint8_t *mem = BigBuf_malloc(size);
|
||||
|
||||
if (!FlashInit())
|
||||
{
|
||||
if (!FlashInit()) {
|
||||
return;
|
||||
}
|
||||
Flash_CheckBusy(BUSY_TIMEOUT);
|
||||
|
@ -309,9 +305,7 @@ void WriteTagToFlash(uint8_t index, size_t size)
|
|||
// cnt = 0;
|
||||
emlGetMem(data, 0, (size * 64)/1024);
|
||||
|
||||
//if (!FlashFastReadInit()){
|
||||
if (!FlashInit())
|
||||
{
|
||||
if (!FlashInit()){
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -38,6 +38,10 @@
|
|||
#include "usart.h"
|
||||
#endif
|
||||
|
||||
#ifdef WITH_FLASH
|
||||
#include "flashmem.h"
|
||||
#endif
|
||||
|
||||
//=============================================================================
|
||||
// A buffer where we can queue things up to be sent through the FPGA, for
|
||||
// any purpose (fake tag, as reader, whatever). We go MSB first, since that
|
||||
|
@ -387,7 +391,9 @@ void printUSBSpeed(void) {
|
|||
void SendStatus(void) {
|
||||
BigBuf_print_status();
|
||||
Fpga_print_status();
|
||||
#ifdef WITH_FLASH
|
||||
Flashmem_print_status();
|
||||
#endif
|
||||
#ifdef WITH_SMARTCARD
|
||||
I2C_print_status();
|
||||
#endif
|
||||
|
@ -1222,7 +1228,9 @@ void UsbPacketReceived(uint8_t *packet, int len) {
|
|||
|
||||
uint8_t *mem = BigBuf_malloc(size);
|
||||
|
||||
FlashInit();
|
||||
if (!FlashInit()) {
|
||||
break;
|
||||
}
|
||||
//Flash_CheckBusy(BUSY_TIMEOUT);
|
||||
|
||||
for(size_t i = 0; i < len; i += size) {
|
||||
|
@ -1251,8 +1259,7 @@ void UsbPacketReceived(uint8_t *packet, int len) {
|
|||
|
||||
uint32_t tmp = startidx + len;
|
||||
|
||||
if (!FlashInit())
|
||||
{
|
||||
if (!FlashInit()) {
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1323,7 +1330,9 @@ void UsbPacketReceived(uint8_t *packet, int len) {
|
|||
// arg1 = length bytes to transfer
|
||||
// arg2 = RFU
|
||||
|
||||
FlashInit();
|
||||
if (!FlashInit()) {
|
||||
break;
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < numofbytes; i += USB_CMD_DATA_SIZE) {
|
||||
len = MIN((numofbytes - i), USB_CMD_DATA_SIZE);
|
||||
|
|
|
@ -485,9 +485,6 @@ void Flash_EraseChip(void) {
|
|||
FlashSendLastByte(CHIPERASE);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void Flashmem_print_status(void) {
|
||||
DbpString("Flash memory");
|
||||
Dbprintf(" Baudrate................%dMHz",FLASHMEM_SPIBAUDRATE/1000000);
|
||||
|
|
|
@ -1815,7 +1815,6 @@ void setupIclassReader() {
|
|||
|
||||
SetAdcMuxFor(GPIO_MUXSEL_HIPKD);
|
||||
|
||||
// Reset trace buffer
|
||||
clear_trace();
|
||||
set_tracing(true);
|
||||
|
||||
|
@ -1824,7 +1823,6 @@ void setupIclassReader() {
|
|||
FpgaWriteConfWord(FPGA_MAJOR_MODE_HF_ISO14443A | FPGA_HF_ISO14443A_READER_MOD);
|
||||
SpinDelay(300);
|
||||
|
||||
// Start the timer
|
||||
StartCountSspClk();
|
||||
|
||||
LED_A_ON();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue