Skip to content

Commit

Permalink
source file format
Browse files Browse the repository at this point in the history
  • Loading branch information
FT9R committed Mar 26, 2024
1 parent 0293e3b commit d30643e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 2 additions & 4 deletions UpdateArduinoDir.bat
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
del ".\Examples\ArduinoNano\w25qxx.h"
del ".\Examples\ArduinoNano\w25qxx.cpp"
del ".\Examples\ArduinoNano\w25qxx_Demo.h"
del ".\Examples\ArduinoNano\w25qxx_Demo.cpp"
del ".\Examples\ArduinoNano\w25qxx.*"
del ".\Examples\ArduinoNano\w25qxx_Demo.*"

xcopy ".\w25qxx\w25qxx.h" ".\Examples\ArduinoNano"
xcopy ".\w25qxx\w25qxx.c" ".\Examples\ArduinoNano"
Expand Down
5 changes: 5 additions & 0 deletions w25qxx/w25qxx.c
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,7 @@ w25qxx_Status_t w25qxx_WaitWithTimeout(w25qxx_HandleTypeDef *w25qxx_Handle, uint
{
w25qxx_Handle->error = W25QXX_ERROR_SPI;
w25qxx_Handle->interface.CS_Set(W25QXX_CS_HIGH);

return W25QXX_STATUS_UNDEFINED;
}

Expand All @@ -590,20 +591,23 @@ w25qxx_Status_t w25qxx_WaitWithTimeout(w25qxx_HandleTypeDef *w25qxx_Handle, uint
{
w25qxx_Handle->error = W25QXX_ERROR_SPI;
w25qxx_Handle->interface.CS_Set(W25QXX_CS_HIGH);

return W25QXX_STATUS_UNDEFINED;
}

/* Get busy bit state */
if (!READ_BIT(w25qxx_Handle->statusRegister, 1u << 0))
{
w25qxx_Handle->interface.CS_Set(W25QXX_CS_HIGH);

return W25QXX_STATUS_READY;
}

/* Timeout check */
if ((uwTick - tickStart) > timeout)
{
w25qxx_Handle->interface.CS_Set(W25QXX_CS_HIGH);

return W25QXX_STATUS_BUSY;
}
}
Expand Down Expand Up @@ -759,6 +763,7 @@ static uint16_t ModBus_CRC(const uint8_t *pBuffer, uint16_t bufSize)
for (i = 0; i < bufSize; i++)
{
CRC16 ^= pBuffer[i];

for (j = 0; j < 8; j++)
{
if (CRC16 & 1)
Expand Down

0 comments on commit d30643e

Please sign in to comment.