LCOV - code coverage report
Current view: top level - ports/unix - fatfs_port.c (source / functions) Hit Total Coverage
Test: unix_coverage_v1.19.1-740-gbf49a087b.info Lines: 9 9 100.0 %
Date: 2022-12-09 11:55:04 Functions: 1 1 100.0 %
Branches: 0 0 -

           Branch data     Line data    Source code
       1                 :            : #include <time.h>
       2                 :            : #include "lib/oofatfs/ff.h"
       3                 :            : 
       4                 :        174 : DWORD get_fattime(void) {
       5                 :        174 :     time_t now = time(NULL);
       6                 :        174 :     struct tm *tm = localtime(&now);
       7                 :        174 :     return ((1900 + tm->tm_year - 1980) << 25)
       8                 :        174 :            | ((tm->tm_mon + 1) << 21)
       9                 :        174 :            | (tm->tm_mday << 16)
      10                 :        174 :            | (tm->tm_hour << 11)
      11                 :        174 :            | (tm->tm_min << 5)
      12                 :        174 :            | (tm->tm_sec / 2);
      13                 :            : }

Generated by: LCOV version 1.15-5-g462f71d