You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
CubeSatSim/libs/libmf/source/flashwait.c

24 lines
368 B

#include "ax8052.h"
#include "libmfflash.h"
int8_t flash_wait(uint16_t timeout)
{
uint8_t __autodata st;
uint8_t __autodata cnth = timeout >> 8;
uint8_t __autodata cntl = timeout;
++cnth;
++cntl;
do {
do {
st = NVSTATUS;
if (!(st & 2))
return -2;
if (!(st & 1))
return 0;
--cntl;
} while (cntl);
--cnth;
} while (cnth);
return -1;
}

Powered by TurnKey Linux.