Merge pull request #2 from alfishe/master

Improved compatibility with various GCC-supported C language standards
This commit is contained in:
sorgelig
2017-08-08 01:42:22 +08:00
committed by GitHub

View File

@@ -21,6 +21,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <time.h>
#include <stdio.h>
#include <unistd.h>
#include <stdint.h>
#include "hardware.h"
#include "user_io.h"
@@ -52,9 +53,10 @@ void hexdump(void *data, uint16_t size, uint16_t offset)
unsigned long GetTimer(unsigned long offset)
{
struct timespec tp;
clock_gettime(CLOCK_BOOTTIME, &tp);
unsigned long long res;
clock_gettime(CLOCK_BOOTTIME, &tp);
uint64_t res;
res = tp.tv_sec;
res *= 1000;