LCOV - code coverage report
Current view: top level - ports/unix - fatfs_port.c (source / functions) Hit Total Coverage
Test: unix_coverage_v1.22.0-333-g49ce7a607.info Lines: 9 9 100.0 %
Date: 2024-04-22 10:07:55 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                 :        178 : DWORD get_fattime(void) {
       5                 :        178 :     time_t now = time(NULL);
       6                 :        178 :     struct tm *tm = localtime(&now);
       7                 :        178 :     return ((1900 + tm->tm_year - 1980) << 25)
       8                 :        178 :            | ((tm->tm_mon + 1) << 21)
       9                 :        178 :            | (tm->tm_mday << 16)
      10                 :        178 :            | (tm->tm_hour << 11)
      11                 :        178 :            | (tm->tm_min << 5)
      12                 :        178 :            | (tm->tm_sec / 2);
      13                 :            : }

Generated by: LCOV version 1.15-5-g462f71d