mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 13:53:55 -07:00
bootloader: fix missing prototypes and shadowed vars
This commit is contained in:
parent
b40c8dd5d2
commit
f9463d183a
2 changed files with 20 additions and 16 deletions
|
@ -394,7 +394,7 @@ static const char StrMS_OSDescriptor[] = {
|
|||
'M', 0, 'S', 0, 'F', 0, 'T', 0, '1', 0, '0', 0, '0', 0, MS_VENDOR_CODE, 0
|
||||
};
|
||||
|
||||
const char *getStringDescriptor(uint8_t idx) {
|
||||
static const char *getStringDescriptor(uint8_t idx) {
|
||||
switch (idx) {
|
||||
case 0:
|
||||
return StrLanguageCodes;
|
||||
|
@ -793,7 +793,7 @@ int usb_write(const uint8_t *data, const size_t len) {
|
|||
* \brief Send Data through the control endpoint
|
||||
*----------------------------------------------------------------------------
|
||||
*/
|
||||
void AT91F_USB_SendData(AT91PS_UDP pUdp, const char *pData, uint32_t length) {
|
||||
void AT91F_USB_SendData(AT91PS_UDP pudp, const char *pData, uint32_t length) {
|
||||
AT91_REG csr;
|
||||
|
||||
do {
|
||||
|
@ -801,17 +801,17 @@ void AT91F_USB_SendData(AT91PS_UDP pUdp, const char *pData, uint32_t length) {
|
|||
length -= cpt;
|
||||
|
||||
while (cpt--)
|
||||
pUdp->UDP_FDR[AT91C_EP_CONTROL] = *pData++;
|
||||
pudp->UDP_FDR[AT91C_EP_CONTROL] = *pData++;
|
||||
|
||||
if (pUdp->UDP_CSR[AT91C_EP_CONTROL] & AT91C_UDP_TXCOMP) {
|
||||
if (pudp->UDP_CSR[AT91C_EP_CONTROL] & AT91C_UDP_TXCOMP) {
|
||||
UDP_CLEAR_EP_FLAGS(AT91C_EP_CONTROL, AT91C_UDP_TXCOMP);
|
||||
while (pUdp->UDP_CSR[AT91C_EP_CONTROL] & AT91C_UDP_TXCOMP);
|
||||
while (pudp->UDP_CSR[AT91C_EP_CONTROL] & AT91C_UDP_TXCOMP);
|
||||
}
|
||||
|
||||
UDP_SET_EP_FLAGS(AT91C_EP_CONTROL, AT91C_UDP_TXPKTRDY);
|
||||
|
||||
do {
|
||||
csr = pUdp->UDP_CSR[AT91C_EP_CONTROL];
|
||||
csr = pudp->UDP_CSR[AT91C_EP_CONTROL];
|
||||
// Data IN stage has been stopped by a status OUT
|
||||
if (csr & AT91C_UDP_RX_DATA_BK0) {
|
||||
|
||||
|
@ -822,9 +822,9 @@ void AT91F_USB_SendData(AT91PS_UDP pUdp, const char *pData, uint32_t length) {
|
|||
|
||||
} while (length);
|
||||
|
||||
if (pUdp->UDP_CSR[AT91C_EP_CONTROL] & AT91C_UDP_TXCOMP) {
|
||||
if (pudp->UDP_CSR[AT91C_EP_CONTROL] & AT91C_UDP_TXCOMP) {
|
||||
UDP_CLEAR_EP_FLAGS(AT91C_EP_CONTROL, AT91C_UDP_TXCOMP);
|
||||
while (pUdp->UDP_CSR[AT91C_EP_CONTROL] & AT91C_UDP_TXCOMP);
|
||||
while (pudp->UDP_CSR[AT91C_EP_CONTROL] & AT91C_UDP_TXCOMP);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -833,22 +833,22 @@ void AT91F_USB_SendData(AT91PS_UDP pUdp, const char *pData, uint32_t length) {
|
|||
//* \fn AT91F_USB_SendZlp
|
||||
//* \brief Send zero length packet through the control endpoint
|
||||
//*----------------------------------------------------------------------------
|
||||
void AT91F_USB_SendZlp(AT91PS_UDP pUdp) {
|
||||
void AT91F_USB_SendZlp(AT91PS_UDP pudp) {
|
||||
UDP_SET_EP_FLAGS(AT91C_EP_CONTROL, AT91C_UDP_TXPKTRDY);
|
||||
while (!(pUdp->UDP_CSR[AT91C_EP_CONTROL] & AT91C_UDP_TXCOMP)) {};
|
||||
while (!(pudp->UDP_CSR[AT91C_EP_CONTROL] & AT91C_UDP_TXCOMP)) {};
|
||||
UDP_CLEAR_EP_FLAGS(AT91C_EP_CONTROL, AT91C_UDP_TXCOMP);
|
||||
while (pUdp->UDP_CSR[AT91C_EP_CONTROL] & AT91C_UDP_TXCOMP) {};
|
||||
while (pudp->UDP_CSR[AT91C_EP_CONTROL] & AT91C_UDP_TXCOMP) {};
|
||||
}
|
||||
|
||||
//*----------------------------------------------------------------------------
|
||||
//* \fn AT91F_USB_SendStall
|
||||
//* \brief Stall the control endpoint
|
||||
//*----------------------------------------------------------------------------
|
||||
void AT91F_USB_SendStall(AT91PS_UDP pUdp) {
|
||||
void AT91F_USB_SendStall(AT91PS_UDP pudp) {
|
||||
UDP_SET_EP_FLAGS(AT91C_EP_CONTROL, AT91C_UDP_FORCESTALL);
|
||||
while (!(pUdp->UDP_CSR[AT91C_EP_CONTROL] & AT91C_UDP_ISOERROR)) {};
|
||||
while (!(pudp->UDP_CSR[AT91C_EP_CONTROL] & AT91C_UDP_ISOERROR)) {};
|
||||
UDP_CLEAR_EP_FLAGS(AT91C_EP_CONTROL, (AT91C_UDP_FORCESTALL | AT91C_UDP_ISOERROR));
|
||||
while (pUdp->UDP_CSR[AT91C_EP_CONTROL] & (AT91C_UDP_FORCESTALL | AT91C_UDP_ISOERROR)) {};
|
||||
while (pudp->UDP_CSR[AT91C_EP_CONTROL] & (AT91C_UDP_FORCESTALL | AT91C_UDP_ISOERROR)) {};
|
||||
}
|
||||
|
||||
//*----------------------------------------------------------------------------
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue