Commit 7c72f5d8acf8eb88b24d490f92511d3e14e0542d
1 parent
672f41a6
--no commit message
Showing
1 changed file
with
7 additions
and
7 deletions
Project/applications/smartcities/test_timer-loop.c
@@ -2,13 +2,13 @@ | @@ -2,13 +2,13 @@ | ||
2 | #include "timer-loop.h" | 2 | #include "timer-loop.h" |
3 | 3 | ||
4 | /* Funcions que simulen comportament real */ | 4 | /* Funcions que simulen comportament real */ |
5 | -void testf(unsigned int delay, const char* premesg, const char* postmesg) | 5 | +void testf(unsigned long delay, const char* premesg, const char* postmesg) |
6 | { | 6 | { |
7 | printf("%s\r\n",premesg); | 7 | printf("%s\r\n",premesg); |
8 | sleep_thread(delay); | 8 | sleep_thread(delay); |
9 | printf("%s\r\n",postmesg); | 9 | printf("%s\r\n",postmesg); |
10 | } | 10 | } |
11 | -unsigned int getNTPTime() | 11 | +unsigned long getNTPTime() |
12 | { | 12 | { |
13 | testf(1,"Asking for NTP time...", "NTP time received"); | 13 | testf(1,"Asking for NTP time...", "NTP time received"); |
14 | return getSystemTime(); | 14 | return getSystemTime(); |
@@ -36,7 +36,7 @@ void main(void) | @@ -36,7 +36,7 @@ void main(void) | ||
36 | 36 | ||
37 | // Code | 37 | // Code |
38 | 38 | ||
39 | - int i = 1; | 39 | + long i = 1; |
40 | printf(",----------------.\r\n"); | 40 | printf(",----------------.\r\n"); |
41 | printf("| TIME LOOP TEST |\r\n"); | 41 | printf("| TIME LOOP TEST |\r\n"); |
42 | printf("'----------------'\r\n\r\n"); | 42 | printf("'----------------'\r\n\r\n"); |
@@ -44,10 +44,10 @@ void main(void) | @@ -44,10 +44,10 @@ void main(void) | ||
44 | printf("--------\r\n"); | 44 | printf("--------\r\n"); |
45 | printf("Loop #0\r\n\r\n"); | 45 | printf("Loop #0\r\n\r\n"); |
46 | 46 | ||
47 | - unsigned int time = getNTPTime(); | ||
48 | - unsigned int timestamp = 0; | ||
49 | - unsigned int delay = getSystemTime(); | ||
50 | - unsigned int delay2 = 0; | 47 | + unsigned long time = getNTPTime(); |
48 | + unsigned long timestamp = 0; | ||
49 | + unsigned long delay = getSystemTime(); | ||
50 | + unsigned long delay2 = 0; | ||
51 | sleep_thread(SHORT_PERIOD - time%SHORT_PERIOD); | 51 | sleep_thread(SHORT_PERIOD - time%SHORT_PERIOD); |
52 | 52 | ||
53 | //int* a_rawData; | 53 | //int* a_rawData; |