How to use time.h and math.h in nrf connect sdk?

1)I want to use "mktime" and "localtime" in my nrf52840 code ,how do i include time.h file?


2)I am using math.h file , in prj.conf i define "CONFIG_NEWLIB_LIBC=y"  but I continuously  get error as below ,how do i resolve it?

error:

/usr/include/math.h:415:33: error: '_Float128' is not supported on this target
415 | # define _Mdouble_ _Float128
Parents
  • No, you are going wrong

    /usr/include  its a system library, basic files which are used.


    1) In sdk v2.3.0 file as below 
    /ncs/v2.3.0/modules/lib/hostap/src/utils/os_zephyr.c

    In function

    int os_mktime(int year, int month, int day, int hour, int min, int sec,
    os_time_t *t)

    using 
    mktime and localtime  using this function where i can find its definition.

    can you give me exact path?


    2)In file as below
    ncs/v2.3.0/nrf/include/net/nrf_cloud_alerts.h

    included math.h
    file

    from where it is called( from which path).?


    3) in first example you give me sample code with gmtime , i want with mktime ,can you give me with it.
Reply
  • No, you are going wrong

    /usr/include  its a system library, basic files which are used.


    1) In sdk v2.3.0 file as below 
    /ncs/v2.3.0/modules/lib/hostap/src/utils/os_zephyr.c

    In function

    int os_mktime(int year, int month, int day, int hour, int min, int sec,
    os_time_t *t)

    using 
    mktime and localtime  using this function where i can find its definition.

    can you give me exact path?


    2)In file as below
    ncs/v2.3.0/nrf/include/net/nrf_cloud_alerts.h

    included math.h
    file

    from where it is called( from which path).?


    3) in first example you give me sample code with gmtime , i want with mktime ,can you give me with it.
Children
Related