Pete
Forum Replies Created
-
AuthorPosts
-
Pete
ParticipantHi Jason –
Thanks so much for the example code!
Your code works perfectly for me. With this, I now have a good example, and can work to fix my code.
I really appreciate you taking the time to help this amateur out!
Pete
ParticipantThanks for looking at my code snippets, Jason –
I have other code that uses the same format and works fine, so I don’t think it has to do with my check on MDOT_OK. I did change my test to:
if ((ret = dot->readUserBackupRegister(0, sleeptime)) == true)
But no difference.
The problem is that it successfully reads and writes, but the actual data is no good.
When waking from sleep, I get –
Read in sleeptime as 134219489Even though I have written the register to be 1, it still reads as 134219489.
Register 1 is no better, it’s just a 0, and I cannot change it.
Pete
ParticipantAre there no Multitech devs around there that help a guy out?
Pete
ParticipantI’m sorry, I was not very clear, and had typos. Both readUserBackRegister and write fail.
Beginning code:
if ((ret = dot->readUserBackupRegister(0, sleeptime)) != mDot::MDOT_OK){ pc.printf("Failed to read - sleeptime is %d\r\n",sleeptime); } else { pc.printf("Read in sleeptime as %d\r\n",sleeptime); } if(sleeptime > 2000) sleeptime = 1; // sleeptime is some crazy number pc.printf("Sleep set for %d Minutes\n\r", sleeptime);
End Code
if ((ret = dot->writeUserBackupRegister(0, sleeptime)) != mDot::MDOT_OK){ pc.printf("Failed to write sleeptime\r\n"); } else { pc.printf("Wrote sleeptime as %d\r\n",sleeptime); }
Output is
Failed to read - sleeptime is 134219489 Sleep set for 1 Minutes . . . Failed to write sleeptime Sleeping 60 seconds or 1 minutes.
-
This reply was modified 7 years, 3 months ago by
Pete.
Pete
ParticipantAnyone?
This is an mDot, that I’m trying to keep persistent variables across sleep.
Pete
ParticipantHi Mike –
Sorry, I should have mentioned – I’m on Win 10 Pro, on a Microsoft Surface, no less.
I’ve done plenty of programming mbed+NXP so I think my environment is good otherwise.
-
This reply was modified 7 years, 3 months ago by
-
AuthorPosts