初始化版本
This commit is contained in:
21
port/menu_port.c
Normal file
21
port/menu_port.c
Normal file
@ -0,0 +1,21 @@
|
||||
#include "menu_port.h"
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <time.h>
|
||||
|
||||
void menu_port_init(void) {
|
||||
// Platform specific init
|
||||
}
|
||||
|
||||
uint32_t menu_port_get_tick(void) {
|
||||
// Return ms
|
||||
return (uint32_t)(clock() * 1000 / CLOCKS_PER_SEC);
|
||||
}
|
||||
|
||||
void menu_port_log(const char* fmt, ...) {
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
vprintf(fmt, args);
|
||||
va_end(args);
|
||||
printf("\n");
|
||||
}
|
||||
18
port/menu_port.h
Normal file
18
port/menu_port.h
Normal file
@ -0,0 +1,18 @@
|
||||
#ifndef MENU_PORT_H
|
||||
#define MENU_PORT_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void menu_port_init(void);
|
||||
uint32_t menu_port_get_tick(void);
|
||||
void menu_port_log(const char* fmt, ...);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // MENU_PORT_H
|
||||
Reference in New Issue
Block a user