5 years, 7 months ago.

How do you update time with set_time() more than once?

I would like to use a GSM module to update the time on my MAX32620FTHR periodically, let's say once every minute, and use this value. However when I use set_time() it only works the first time it's called. Any future calls do not update the time or reset it. I tried looking up an explanation of how set_time() works in the documentation but could not find anything which describes why I'm having this problem. Can you only call set_time() once in your program? Any suggestions on how to use set_time() repeatedly in a program would be very helpful. Thanks in advance for any advice people can give.

1 Answer

5 years, 7 months ago.

Hi Jordan,

You can call set_time() more than once. It's possible that you are being impacted by this issue that was recently uncovered:

And there is a (one-line) proposed fix available here:

Could you please introduce this pull request into your code and see if that fixes things?

Regards,

Ralph, Team Mbed

Accepted Answer

Here are instructions on how to pull just one pull request locally:

  1. cd mbed-os
  2. git fetch origin pull/ID/head:patch-1 where ID = pull request number
  3. git checkout patch-1

- Jenny, team Mbed

posted by Jenny Plunkett 05 Sep 2018