fix: update line endings and adjust stlink configuration
This commit is contained in:
@ -59,7 +59,7 @@ uint8_t ADDR = 0x01 * 4 + 0x03;
|
||||
uint8_t KEY_A[6]= {0xff,0xff,0xff,0xff,0xff,0xff};
|
||||
uint8_t KEY_B[6]= {0xff,0xff,0xff,0xff,0xff,0xff};
|
||||
|
||||
const char* SEP = "-------------------------\n";
|
||||
const char* SEP = "-------------------------\r\n";
|
||||
/* USER CODE END PV */
|
||||
|
||||
/* Private function prototypes -----------------------------------------------*/
|
||||
@ -118,7 +118,7 @@ int main(void)
|
||||
OLED_Clear();
|
||||
|
||||
OLED_ShowString(0,0,"scanning...",12);
|
||||
printf("[icpile] dev\n");
|
||||
printf("[icpile] dev\r\n");
|
||||
/* USER CODE END 2 */
|
||||
|
||||
/* Infinite loop */
|
||||
@ -136,8 +136,8 @@ int main(void)
|
||||
if (!rf_status) {
|
||||
rf_status = PCD_ERR;
|
||||
printf(SEP);
|
||||
printf("[i] Card Type: %02X %02X %02X\n", rf_card_type[0], rf_card_type[1], rf_card_type[2]);
|
||||
printf("[i] Card ID : %02X-%02X-%02X-%02X\n", rf_card_id[0], rf_card_id[1], rf_card_id[2], rf_card_id[3]);
|
||||
printf("[i] Card Type: %02X %02X %02X\r\n", rf_card_type[0], rf_card_type[1], rf_card_type[2]);
|
||||
printf("[i] Card ID : %02X-%02X-%02X-%02X\r\n", rf_card_id[0], rf_card_id[1], rf_card_id[2], rf_card_id[3]);
|
||||
|
||||
OLED_ShowString(0, 2, "Typ:", 12);
|
||||
uint8_t card_type_buffer[9];
|
||||
@ -158,21 +158,21 @@ int main(void)
|
||||
rf_status = PCD_AuthState(PICC_AUTHENT1A, ADDR, KEY_A, rf_card_id);
|
||||
if(rf_status == PCD_OK)
|
||||
{
|
||||
printf("[*] Key A pass\n");
|
||||
printf("[*] Key A pass\r\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("[!] Key A verification failed\n");
|
||||
printf("[!] Key A verification failed\r\n");
|
||||
}
|
||||
|
||||
rf_status = PCD_AuthState(PICC_AUTHENT1B, ADDR, KEY_B, rf_card_id);
|
||||
if(rf_status == PCD_OK)
|
||||
{
|
||||
printf("[*] Key B pass\n");
|
||||
printf("[*] Key B pass\r\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("[!] Key B verification failed\n");
|
||||
printf("[!] Key B verification failed\r\n");
|
||||
}
|
||||
}
|
||||
|
||||
@ -188,11 +188,11 @@ int main(void)
|
||||
{
|
||||
printf("%02x", rf_data[i]);
|
||||
}
|
||||
printf("\n");
|
||||
printf("\r\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("Read card failed\n");
|
||||
printf("Read card failed\r\n");
|
||||
}
|
||||
HAL_GPIO_WritePin(LED_BTN1_GPIO_Port, LED_BTN1_Pin, GPIO_PIN_RESET);
|
||||
HAL_Delay(3000);
|
||||
|
Reference in New Issue
Block a user