Copyright © https://mongoose-os.com

Mongoose OS Forum

frame
ATTENTION! This forum has moved to:

https://community.mongoose-os.com

Do not post any new messages.

Using the time() function on the CC3220 platform

As I reported in a previous post, there is a bug in the current version of mongoose-os when using the time() function for the CC3220 platform.

Is this beeing fixed, or can someone give me a hint as to how I could fix this myself?

Comments

  • nliviunliviu Romania
    edited February 2018

    I don't have a CC3220, but this compiles with mos build --local --platform cc3200

    #include "mgos.h"
    
    #if CS_PLATFORM == CS_P_CC3220
    
    time_t HOSTtime()
    {
        struct timeval tp;
        gettimeofday(&tp, NULL);
        return tp.tv_sec;
    }
    #endif
    
    enum mgos_app_init_result mgos_app_init(void)
    {
        time_t now = time(0);
        (void) now;
    
        return MGOS_APP_INIT_SUCCESS;
    }
    

    Reference

    Thanked by 1ulso
  • ulsoulso Stockholm

    Thank you very much!
    Now my project builds ok again.

Sign In or Register to comment.