Hi,
Since no one cared about this, I wrote a simple test program for this issue.
When compiled with mbed lib v157, count and edge_time go together.
But when compiled with mbed lib v160 (current version), up to 22 count and edge_time agrees,
then time begins fly like a banana, at count 22 the time is 4317!
and at count 78, the time is over 30000...
main.cpp
#include "mbed.h"
Ticker *tokei ;
uint32_t edge_time = 0 ;
void inc_sec(void)
{
__disable_irq() ; // Disable Interrupts
edge_time++ ;
__enable_irq() ; // Enable Interrupts
}
void init_timer(void)
{
tokei = new Ticker() ;
tokei->attach(inc_sec, 1.0) ;
}
int main() {
uint32_t count = 0 ;
init_timer() ;
printf("Ticker test program\n") ;
while(1) {
printf("%d: %d\n", count++, edge_time) ;
wait(1.0) ;
}
}
When I compiled this program with mbed lib v157, the output was
Ticker test program
0: 0
1: 1
2: 2
3: 3
4: 4
5: 5
6: 6
7: 7
8: 8
9: 9
10: 10
11: 11
12: 12
13: 13
14: 14
15: 15
16: 16
17: 17
18: 18
19: 19
20: 20
21: 21
22: 22
23: 23
24: 24
25: 25
26: 26
27: 27
28: 28
29: 29
30: 30
31: 31
32: 32
33: 33
34: 34
35: 35
36: 36
37: 37
38: 38
39: 39
40: 40
41: 41
42: 42
43: 43
44: 44
45: 45
46: 46
47: 47
48: 48
49: 49
50: 50
51: 51
52: 52
53: 53
54: 54
55: 55
56: 56
57: 57
58: 58
59: 59
60: 60
61: 61
62: 62
63: 63
64: 64
65: 65
66: 66
67: 67
68: 68
69: 69
70: 70
71: 71
72: 72
73: 73
74: 74
75: 75
76: 76
77: 77
78: 78
79: 79
80: 80
81: 81
82: 82
83: 83
84: 84
85: 85
86: 86
87: 87
88: 88
89: 89
90: 90
91: 91
92: 92
93: 93
94: 94
95: 95
96: 96
97: 97
98: 98
99: 99
100: 100
101: 101
102: 102
103: 103
104: 104
105: 105
106: 106
107: 107
108: 108
109: 109
110: 110
But when I compiled the program with mbed v160 (current version)
Ticker test program
0: 0
1: 1
2: 2
3: 3
4: 4
5: 5
6: 6
7: 7
8: 8
9: 9
10: 10
11: 11
12: 12
13: 13
14: 14
15: 15
16: 16
17: 17
18: 18
19: 19
20: 20
21: 21
22: 4317
23: 4318
24: 4319
25: 4320
26: 4321
27: 4322
28: 4323
29: 4324
30: 4325
31: 4326
32: 4327
33: 4328
34: 4329
35: 4330
36: 4331
37: 4332
38: 4333
39: 4334
40: 4335
41: 4336
42: 4337
43: 4338
44: 4339
45: 4340
46: 4341
47: 4342
48: 4343
49: 8639
50: 8640
51: 8641
52: 8642
53: 8643
54: 8644
55: 12940
56: 12941
57: 12942
58: 12943
59: 17239
60: 17240
61: 17241
62: 17242
63: 17243
64: 17244
65: 17245
66: 17246
67: 17247
68: 17248
69: 17249
70: 17250
71: 17251
72: 17252
73: 21548
74: 25844
75: 25845
76: 25846
77: 25847
78: 30143
79: 30144
80: 30145
81: 30146
82: 30147
83: 30148
84: 30149
85: 34445
86: 38741
87: 38742
88: 38743
moto
Hi,
I've been keeping track of time using
And it has been working till v157.
But from v158, time flies like a banana.
The "supposed to be" 1 second is more than 10 times shorter now.
And it made my program run like a hell.
Although I can survive with v157 for the time being,
I really hope mbed will fix this very soon.
moto
Note: I made mistake of reading version, the version 160 in the title meant 161:aa528, which is v159.