This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2530: osal_nv read/write

Part Number: CC2530


Hi,

I've been trying to test the below to check if a boolean var, REVERSED, had been stored in NV. If not, then it would assign it to false; then write to NV. However, the next time the CC2530 is powered on, it always assigns REVERSED to false again. It seems like I am doing something wrong here. How can I fix this?

  osal_nv_read(nv_test_id, 0, 1, &REVERSED);
  if((REVERSED != true) || (REVERSED != false))
    REVERSED = false;
  osal_nv_write(nv_test_id, 0, 1, &REVERSED);