- /* Poll the STATUS register to check to see if NVM access has been enabled */\r
- uint8_t NVMAttemptsRemaining = 255;\r
- while (NVMAttemptsRemaining)\r
- {\r
- PDITarget_SendByte(PDI_CMD_LDCS | PD_STATUS_REG);\r
- if (PDITarget_ReceiveByte() & PDI_STATUS_NVM)\r
- break;\r
-\r
- NVMAttemptsRemaining--;\r
- }\r
+ /* Wait until the NVM bus becomes active */\r
+ bool NVMBusEnabled = PDITarget_WaitWhileNVMBusBusy();\r