lignite 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +5 -0
- data/NEWS.md +8 -0
- data/VERSION +1 -1
- data/examples/light-sensor.rb +1 -2
- data/lib/lignite/assembler.rb +48 -14
- data/lib/lignite/body_compiler.rb +71 -5
- data/lib/lignite/direct_commands.rb +3 -1
- data/lib/lignite/ev3_ops.rb +255 -14
- data/lib/lignite/op_compiler.rb +1 -1
- data/lib/lignite/parameter_declarer.rb +108 -0
- data/lib/lignite/rbf_declarer.rb +52 -0
- data/lib/lignite/rbf_object.rb +7 -2
- data/lib/lignite/variables.rb +18 -0
- data/lignite.gemspec +8 -0
- data/spec/assembler_spec.rb +9 -6
- data/spec/data/ColorReadout.rb +1 -1
- data/spec/data/Performance.lms +735 -0
- data/spec/data/Performance.rb +690 -0
- data/spec/data/Performance.rbf +0 -0
- data/spec/data/VernierReadout.rb +1 -1
- data/spec/data/p11.c +36 -0
- data/spec/data/p11.rb +20 -0
- data/spec/data/p11.rbf +0 -0
- data/spec/spec_helper.rb +24 -1
- data/tools/ops_from_yml +1 -1
- metadata +10 -2
@@ -0,0 +1,690 @@
|
|
1
|
+
appv = "Performance V1.02"
|
2
|
+
|
3
|
+
TIMES = 100_000
|
4
|
+
MS = 1
|
5
|
+
|
6
|
+
data32 :Ref
|
7
|
+
|
8
|
+
data32 :Counter
|
9
|
+
data32 :Start
|
10
|
+
data32 :Stop
|
11
|
+
data32 :Time
|
12
|
+
dataf :DataF
|
13
|
+
data32 :Data32
|
14
|
+
data32 :Data32_1
|
15
|
+
data32 :Data32_2
|
16
|
+
data32 :Data32_3
|
17
|
+
data32 :Data32_4
|
18
|
+
data16 :hData8
|
19
|
+
data8 :Data8
|
20
|
+
array8 :DataS, 10
|
21
|
+
array8 :Text, 36
|
22
|
+
|
23
|
+
vmthread :MAIN do
|
24
|
+
data8 :ShowVersion
|
25
|
+
|
26
|
+
ui_button_pressed(RIGHT_BUTTON, :ShowVersion)
|
27
|
+
|
28
|
+
self.if :ShowVersion do
|
29
|
+
ui_draw_fillrect(BG_COLOR, 4, 50, 170, 28)
|
30
|
+
ui_draw_rect(FG_COLOR, 6, 52, 166, 24)
|
31
|
+
ui_draw_text(FG_COLOR, 13, 60, appv)
|
32
|
+
ui_draw_update
|
33
|
+
|
34
|
+
loop_while_postcond(:ShowVersion) do
|
35
|
+
ui_button_pressed(RIGHT_BUTTON, :ShowVersion)
|
36
|
+
end
|
37
|
+
|
38
|
+
ui_button_flush
|
39
|
+
end
|
40
|
+
|
41
|
+
ui_draw_restore(0)
|
42
|
+
ui_draw_topline(0)
|
43
|
+
ui_write_led(LED_GREEN)
|
44
|
+
|
45
|
+
move32_f(TIMES, :DataF)
|
46
|
+
ui_draw_fillwindow(BG_COLOR, 0, 0)
|
47
|
+
|
48
|
+
ui_draw(SELECT_FONT, TINY_FONT)
|
49
|
+
ui_draw(TEXT, FG_COLOR, 0, 120, "-----------------------------------")
|
50
|
+
ui_draw(UPDATE)
|
51
|
+
|
52
|
+
ui_draw(SCROLL, 8)
|
53
|
+
ui_draw(SELECT_FONT, TINY_FONT)
|
54
|
+
ui_draw(TEXT, FG_COLOR, 0, 120, "Performance Test (avr.")
|
55
|
+
ui_draw(VALUE, FG_COLOR, 110, 120, :DataF, 7, 0)
|
56
|
+
ui_draw(TEXT, FG_COLOR, 145, 120, "instr)")
|
57
|
+
ui_draw(UPDATE)
|
58
|
+
|
59
|
+
ui_draw(SCROLL, 8)
|
60
|
+
ui_draw(SELECT_FONT, TINY_FONT)
|
61
|
+
ui_draw(TEXT, FG_COLOR, 0, 120, "-----------------------------------")
|
62
|
+
ui_draw(UPDATE)
|
63
|
+
|
64
|
+
ui_draw(SCROLL, 8)
|
65
|
+
ui_draw(SELECT_FONT, TINY_FONT)
|
66
|
+
ui_draw(TEXT, FG_COLOR, 0, 120, "Byte Code [uS]")
|
67
|
+
ui_draw(UPDATE)
|
68
|
+
|
69
|
+
ui_draw(SCROLL, 8)
|
70
|
+
|
71
|
+
ui_write(PUT_STRING, "\r\n ---------------------------------------------")
|
72
|
+
ui_write(PUT_STRING, "\r\n Performance test (average over ")
|
73
|
+
ui_write(VALUE32, TIMES)
|
74
|
+
ui_write(PUT_STRING, " inst.)")
|
75
|
+
ui_write(PUT_STRING, "\r\n ---------------------------------------------")
|
76
|
+
ui_write(PUT_STRING, "\r\n Byte code Time [uS]\r\n\n")
|
77
|
+
ui_flush
|
78
|
+
|
79
|
+
call(:Test_REF)
|
80
|
+
call(:Test_CALL)
|
81
|
+
|
82
|
+
call(:Test_CALL_4x32)
|
83
|
+
call(:Test_MOVEF_32)
|
84
|
+
call(:Test_MOVE32_F)
|
85
|
+
call(:Test_MOVEF_F)
|
86
|
+
call(:Test_ADD32)
|
87
|
+
call(:Test_ADDF)
|
88
|
+
call(:Test_INPUT_READ)
|
89
|
+
# call(:Test_INPUT_DEVICE_READY_PCT)
|
90
|
+
call(:Test_ARRAY_READ)
|
91
|
+
call(:Test_READ8)
|
92
|
+
call(:Test_UI_BUTTON_SHORTPRESS)
|
93
|
+
call(:Test_JR)
|
94
|
+
call(:Test_NOP)
|
95
|
+
|
96
|
+
# call(:Test_UI_DRAW_CLEAN)
|
97
|
+
# call(:Test_UI_DRAW_TEXT_10_aligned)
|
98
|
+
# call(:Test_UI_DRAW_TEXT_10_not_aligned)
|
99
|
+
# call(:Test_UI_DRAW_ICON)
|
100
|
+
# call(:Test_UI_DRAW_BMPFILE)
|
101
|
+
# call(:Test_UI_DRAW_RECT)
|
102
|
+
# call(:Test_UI_DRAW_PIXEL)
|
103
|
+
# call(:Test_UI_DRAW_UPDATE)
|
104
|
+
call(:Test_SLEEP)
|
105
|
+
|
106
|
+
ui_write(PUT_STRING, "\r\n ---------------------------------------------\r\n")
|
107
|
+
ui_flush
|
108
|
+
|
109
|
+
self.loop do
|
110
|
+
# endless
|
111
|
+
end
|
112
|
+
end
|
113
|
+
|
114
|
+
sub :Test_REF do
|
115
|
+
move32_32(0, :Counter)
|
116
|
+
timer_read_us(:Start)
|
117
|
+
|
118
|
+
loop_while lambda {
|
119
|
+
add32(1, :Counter, :Counter)
|
120
|
+
}, Lt32.new(:Counter, TIMES)
|
121
|
+
|
122
|
+
timer_read_us(:Stop)
|
123
|
+
sub32(:Stop, :Start, :Ref)
|
124
|
+
end
|
125
|
+
|
126
|
+
sub :Test_CALL do
|
127
|
+
ui_draw(SCROLL, 8)
|
128
|
+
ui_draw(SELECT_FONT, TINY_FONT)
|
129
|
+
ui_draw(TEXT, FG_COLOR, 0, 120, "CALL() . . . . . . . . . . . ")
|
130
|
+
ui_draw(UPDATE)
|
131
|
+
|
132
|
+
ui_write(PUT_STRING, " CALL().......................... ")
|
133
|
+
ui_flush
|
134
|
+
move32_32(0, :Counter)
|
135
|
+
timer_read_us(:Start)
|
136
|
+
|
137
|
+
loop_while lambda {
|
138
|
+
# TEST ***********************************************
|
139
|
+
call(:CallNoPar)
|
140
|
+
# ****************************************************
|
141
|
+
add32(1, :Counter, :Counter)
|
142
|
+
}, Lt32.new(:Counter, TIMES)
|
143
|
+
|
144
|
+
timer_read_us(:Stop)
|
145
|
+
sub32(:Stop, :Start, :Time)
|
146
|
+
sub32(:Time, :Ref, :Time)
|
147
|
+
|
148
|
+
call(:ShowResult, :Time)
|
149
|
+
end
|
150
|
+
|
151
|
+
sub :Test_CALL_4x32 do
|
152
|
+
ui_draw(SCROLL, 8)
|
153
|
+
ui_draw(SELECT_FONT, TINY_FONT)
|
154
|
+
ui_draw(TEXT, FG_COLOR, 0, 120, "CALL(4xDATA32...) . . . . . ")
|
155
|
+
ui_draw(UPDATE)
|
156
|
+
|
157
|
+
ui_write(PUT_STRING, " CALL(4xDATA32...)............... ")
|
158
|
+
ui_flush
|
159
|
+
move32_32(0, :Counter)
|
160
|
+
timer_read_us(:Start)
|
161
|
+
|
162
|
+
loop_while lambda {
|
163
|
+
# TEST ***********************************************
|
164
|
+
call(:Call4Par, :Data32_1, :Data32_2, :Data32_3, :Data32_4)
|
165
|
+
# ****************************************************
|
166
|
+
add32(1, :Counter, :Counter)
|
167
|
+
}, Lt32.new(:Counter, TIMES)
|
168
|
+
|
169
|
+
timer_read_us(:Stop)
|
170
|
+
sub32(:Stop, :Start, :Time)
|
171
|
+
sub32(:Time, :Ref, :Time)
|
172
|
+
|
173
|
+
call(:ShowResult, :Time)
|
174
|
+
end
|
175
|
+
|
176
|
+
sub :Test_MOVEF_32 do
|
177
|
+
ui_draw(SCROLL, 8)
|
178
|
+
ui_draw(SELECT_FONT, TINY_FONT)
|
179
|
+
ui_draw(TEXT, FG_COLOR, 0, 120, "MOVEF_32 . . . . . . . . . . ")
|
180
|
+
ui_draw(UPDATE)
|
181
|
+
|
182
|
+
ui_write(PUT_STRING, " MOVEF_32........................ ")
|
183
|
+
ui_flush
|
184
|
+
move32_32(0, :Counter)
|
185
|
+
timer_read_us(:Start)
|
186
|
+
|
187
|
+
loop_while lambda {
|
188
|
+
# TEST ***********************************************
|
189
|
+
movef_32(:DataF, :Data32)
|
190
|
+
# ****************************************************
|
191
|
+
add32(1, :Counter, :Counter)
|
192
|
+
}, Lt32.new(:Counter, TIMES)
|
193
|
+
|
194
|
+
timer_read_us(:Stop)
|
195
|
+
sub32(:Stop, :Start, :Time)
|
196
|
+
sub32(:Time, :Ref, :Time)
|
197
|
+
|
198
|
+
call(:ShowResult, :Time)
|
199
|
+
end
|
200
|
+
|
201
|
+
sub :Test_MOVE32_F do
|
202
|
+
ui_draw(SCROLL, 8)
|
203
|
+
ui_draw(SELECT_FONT, TINY_FONT)
|
204
|
+
ui_draw(TEXT, FG_COLOR, 0, 120, "MOVE32_F. . . . . . . . . . ")
|
205
|
+
ui_draw(UPDATE)
|
206
|
+
|
207
|
+
ui_write(PUT_STRING, " MOVE32_F........................ ")
|
208
|
+
ui_flush
|
209
|
+
move32_32(0, :Counter)
|
210
|
+
timer_read_us(:Start)
|
211
|
+
|
212
|
+
loop_while lambda {
|
213
|
+
# TEST ***********************************************
|
214
|
+
move32_f(:Data32, :DataF)
|
215
|
+
# ****************************************************
|
216
|
+
add32(1, :Counter, :Counter)
|
217
|
+
}, Lt32.new(:Counter, TIMES)
|
218
|
+
|
219
|
+
timer_read_us(:Stop)
|
220
|
+
sub32(:Stop, :Start, :Time)
|
221
|
+
sub32(:Time, :Ref, :Time)
|
222
|
+
|
223
|
+
call(:ShowResult, :Time)
|
224
|
+
end
|
225
|
+
|
226
|
+
sub :Test_MOVEF_F do
|
227
|
+
ui_draw(SCROLL, 8)
|
228
|
+
ui_draw(SELECT_FONT, TINY_FONT)
|
229
|
+
ui_draw(TEXT, FG_COLOR, 0, 120, "MOVEF_F. . . . . . . . . . . ")
|
230
|
+
ui_draw(UPDATE)
|
231
|
+
|
232
|
+
ui_write(PUT_STRING, " MOVEF_F......................... ")
|
233
|
+
ui_flush
|
234
|
+
move32_32(0, :Counter)
|
235
|
+
timer_read_us(:Start)
|
236
|
+
|
237
|
+
loop_while lambda {
|
238
|
+
# TEST ***********************************************
|
239
|
+
movef_f(:DataF, :DataF)
|
240
|
+
# ****************************************************
|
241
|
+
add32(1, :Counter, :Counter)
|
242
|
+
}, Lt32.new(:Counter, TIMES)
|
243
|
+
|
244
|
+
timer_read_us(:Stop)
|
245
|
+
sub32(:Stop, :Start, :Time)
|
246
|
+
sub32(:Time, :Ref, :Time)
|
247
|
+
|
248
|
+
call(:ShowResult, :Time)
|
249
|
+
end
|
250
|
+
|
251
|
+
sub :Test_ADD32 do
|
252
|
+
ui_draw(SCROLL, 8)
|
253
|
+
ui_draw(SELECT_FONT, TINY_FONT)
|
254
|
+
ui_draw(TEXT, FG_COLOR, 0, 120, "ADD32 . . . . . . . . . . . ")
|
255
|
+
ui_draw(UPDATE)
|
256
|
+
|
257
|
+
ui_write(PUT_STRING, " ADD32........................... ")
|
258
|
+
ui_flush
|
259
|
+
move32_32(0, :Counter)
|
260
|
+
timer_read_us(:Start)
|
261
|
+
|
262
|
+
loop_while lambda {
|
263
|
+
# TEST ***********************************************
|
264
|
+
add32(1, :Data32, :Data32)
|
265
|
+
# ****************************************************
|
266
|
+
add32(1, :Counter, :Counter)
|
267
|
+
}, Lt32.new(:Counter, TIMES)
|
268
|
+
|
269
|
+
timer_read_us(:Stop)
|
270
|
+
sub32(:Stop, :Start, :Time)
|
271
|
+
sub32(:Time, :Ref, :Time)
|
272
|
+
|
273
|
+
call(:ShowResult, :Time)
|
274
|
+
end
|
275
|
+
|
276
|
+
sub :Test_ADDF do
|
277
|
+
ui_draw(SCROLL, 8)
|
278
|
+
ui_draw(SELECT_FONT, TINY_FONT)
|
279
|
+
ui_draw(TEXT, FG_COLOR, 0, 120, "ADDF . . . . . . . . . . . . ")
|
280
|
+
ui_draw(UPDATE)
|
281
|
+
|
282
|
+
ui_write(PUT_STRING, " ADDF............................ ")
|
283
|
+
ui_flush
|
284
|
+
move32_32(0, :Counter)
|
285
|
+
timer_read_us(:Start)
|
286
|
+
|
287
|
+
loop_while lambda {
|
288
|
+
# TEST ***********************************************
|
289
|
+
addf(1.0, :DataF, :DataF)
|
290
|
+
# ****************************************************
|
291
|
+
add32(1, :Counter, :Counter)
|
292
|
+
}, Lt32.new(:Counter, TIMES)
|
293
|
+
|
294
|
+
timer_read_us(:Stop)
|
295
|
+
sub32(:Stop, :Start, :Time)
|
296
|
+
sub32(:Time, :Ref, :Time)
|
297
|
+
|
298
|
+
call(:ShowResult, :Time)
|
299
|
+
end
|
300
|
+
|
301
|
+
sub :Test_INPUT_READ do
|
302
|
+
ui_draw(SCROLL, 8)
|
303
|
+
ui_draw(SELECT_FONT, TINY_FONT)
|
304
|
+
ui_draw(TEXT, FG_COLOR, 0, 120, "INPUT_READ. . . . . . . . . ")
|
305
|
+
ui_draw(UPDATE)
|
306
|
+
|
307
|
+
ui_write(PUT_STRING, " INPUT_READ...................... ")
|
308
|
+
ui_flush
|
309
|
+
move32_32(0, :Counter)
|
310
|
+
timer_read_us(:Start)
|
311
|
+
|
312
|
+
loop_while lambda {
|
313
|
+
# TEST ***********************************************
|
314
|
+
input_read(0, 0, 0, -1, :Data8)
|
315
|
+
# ****************************************************
|
316
|
+
add32(1, :Counter, :Counter)
|
317
|
+
}, Lt32.new(:Counter, TIMES)
|
318
|
+
|
319
|
+
timer_read_us(:Stop)
|
320
|
+
sub32(:Stop, :Start, :Time)
|
321
|
+
sub32(:Time, :Ref, :Time)
|
322
|
+
|
323
|
+
call(:ShowResult, :Time)
|
324
|
+
end
|
325
|
+
|
326
|
+
sub :Test_INPUT_DEVICE_READY_PCT do
|
327
|
+
ui_draw(SCROLL, 8)
|
328
|
+
ui_draw(SELECT_FONT, TINY_FONT)
|
329
|
+
ui_draw(TEXT, FG_COLOR, 0, 120, "INPUT_DEVICE(READY_PCT...) . ")
|
330
|
+
ui_draw(UPDATE)
|
331
|
+
|
332
|
+
ui_write(PUT_STRING, " INPUT_DEVICE(READY_PCT...)...... ")
|
333
|
+
ui_flush
|
334
|
+
move32_32(0, :Counter)
|
335
|
+
timer_read_us(:Start)
|
336
|
+
|
337
|
+
loop_while lambda {
|
338
|
+
# TEST ***********************************************
|
339
|
+
input_device(READY_PCT, 0, 0, 0, -1, :Data8)
|
340
|
+
# ****************************************************
|
341
|
+
add32(1, :Counter, :Counter)
|
342
|
+
}, Lt32.new(:Counter, TIMES)
|
343
|
+
|
344
|
+
timer_read_us(:Stop)
|
345
|
+
sub32(:Stop, :Start, :Time)
|
346
|
+
sub32(:Time, :Ref, :Time)
|
347
|
+
|
348
|
+
call(:ShowResult, :Time)
|
349
|
+
end
|
350
|
+
|
351
|
+
sub :Test_ARRAY_READ do
|
352
|
+
ui_draw(SCROLL, 8)
|
353
|
+
ui_draw(SELECT_FONT, TINY_FONT)
|
354
|
+
ui_draw(TEXT, FG_COLOR, 0, 120, "ARRAY_READ(...) . . . . . . ")
|
355
|
+
ui_draw(UPDATE)
|
356
|
+
|
357
|
+
ui_write(PUT_STRING, " ARRAY_READ(...)................. ")
|
358
|
+
ui_flush
|
359
|
+
array(CREATE8, 10, :hData8)
|
360
|
+
move32_32(0, :Counter)
|
361
|
+
timer_read_us(:Start)
|
362
|
+
|
363
|
+
loop_while lambda {
|
364
|
+
# TEST ***********************************************
|
365
|
+
array_read(:hData8, 5, :Data8)
|
366
|
+
# ****************************************************
|
367
|
+
add32(1, :Counter, :Counter)
|
368
|
+
}, Lt32.new(:Counter, TIMES)
|
369
|
+
|
370
|
+
timer_read_us(:Stop)
|
371
|
+
sub32(:Stop, :Start, :Time)
|
372
|
+
sub32(:Time, :Ref, :Time)
|
373
|
+
|
374
|
+
call(:ShowResult, :Time)
|
375
|
+
end
|
376
|
+
|
377
|
+
sub :Test_READ8 do
|
378
|
+
ui_draw(SCROLL, 8)
|
379
|
+
ui_draw(SELECT_FONT, TINY_FONT)
|
380
|
+
ui_draw(TEXT, FG_COLOR, 0, 120, "READ8(...) . . . . . . . . . ")
|
381
|
+
ui_draw(UPDATE)
|
382
|
+
|
383
|
+
ui_write(PUT_STRING, " READ8(...)...................... ")
|
384
|
+
ui_flush
|
385
|
+
move32_32(0, :Counter)
|
386
|
+
timer_read_us(:Start)
|
387
|
+
|
388
|
+
loop_while lambda {
|
389
|
+
# TEST ***********************************************
|
390
|
+
read8(:DataS, 5, :Data8)
|
391
|
+
# ****************************************************
|
392
|
+
add32(1, :Counter, :Counter)
|
393
|
+
}, Lt32.new(:Counter, TIMES)
|
394
|
+
|
395
|
+
timer_read_us(:Stop)
|
396
|
+
sub32(:Stop, :Start, :Time)
|
397
|
+
sub32(:Time, :Ref, :Time)
|
398
|
+
|
399
|
+
call(:ShowResult, :Time)
|
400
|
+
end
|
401
|
+
|
402
|
+
sub :Test_UI_BUTTON_SHORTPRESS do
|
403
|
+
ui_draw(SCROLL, 8)
|
404
|
+
ui_draw(SELECT_FONT, TINY_FONT)
|
405
|
+
ui_draw(TEXT, FG_COLOR, 0, 120, "UI_BUTTON(SHORTPRESS...). . ")
|
406
|
+
ui_draw(UPDATE)
|
407
|
+
|
408
|
+
ui_write(PUT_STRING, " UI_BUTTON(SHORTPRESS...)........ ")
|
409
|
+
ui_flush
|
410
|
+
move32_32(0, :Counter)
|
411
|
+
timer_read_us(:Start)
|
412
|
+
|
413
|
+
loop_while lambda {
|
414
|
+
# TEST ***********************************************
|
415
|
+
ui_button(SHORTPRESS, ENTER_BUTTON, :Data8)
|
416
|
+
# ****************************************************
|
417
|
+
add32(1, :Counter, :Counter)
|
418
|
+
}, Lt32.new(:Counter, TIMES)
|
419
|
+
|
420
|
+
timer_read_us(:Stop)
|
421
|
+
sub32(:Stop, :Start, :Time)
|
422
|
+
sub32(:Time, :Ref, :Time)
|
423
|
+
|
424
|
+
call(:ShowResult, :Time)
|
425
|
+
end
|
426
|
+
|
427
|
+
sub :Test_JR do
|
428
|
+
ui_draw(SCROLL, 8)
|
429
|
+
ui_draw(SELECT_FONT, TINY_FONT)
|
430
|
+
ui_draw(TEXT, FG_COLOR, 0, 120, "JR(...). . . . . . . . . . . ")
|
431
|
+
ui_draw(UPDATE)
|
432
|
+
|
433
|
+
ui_write(PUT_STRING, " JR(...)......................... ")
|
434
|
+
ui_flush
|
435
|
+
move32_32(0, :Counter)
|
436
|
+
timer_read_us(:Start)
|
437
|
+
|
438
|
+
loop_while lambda {
|
439
|
+
# TEST ***********************************************
|
440
|
+
jr(Complex(0, 2))
|
441
|
+
# ****************************************************
|
442
|
+
add32(1, :Counter, :Counter)
|
443
|
+
}, Lt32.new(:Counter, TIMES)
|
444
|
+
|
445
|
+
timer_read_us(:Stop)
|
446
|
+
sub32(:Stop, :Start, :Time)
|
447
|
+
sub32(:Time, :Ref, :Time)
|
448
|
+
|
449
|
+
call(:ShowResult, :Time)
|
450
|
+
end
|
451
|
+
|
452
|
+
sub :Test_NOP do
|
453
|
+
ui_draw(SCROLL, 8)
|
454
|
+
ui_draw(SELECT_FONT, TINY_FONT)
|
455
|
+
ui_draw(TEXT, FG_COLOR, 0, 120, "NOP . . . . . . . . . . . . ")
|
456
|
+
ui_draw(UPDATE)
|
457
|
+
|
458
|
+
ui_write(PUT_STRING, " NOP ............................ ")
|
459
|
+
ui_flush
|
460
|
+
move32_32(0, :Counter)
|
461
|
+
timer_read_us(:Start)
|
462
|
+
|
463
|
+
loop_while lambda {
|
464
|
+
# TEST ***********************************************
|
465
|
+
nop
|
466
|
+
# ****************************************************
|
467
|
+
add32(1, :Counter, :Counter)
|
468
|
+
}, Lt32.new(:Counter, TIMES)
|
469
|
+
|
470
|
+
timer_read_us(:Stop)
|
471
|
+
sub32(:Stop, :Start, :Time)
|
472
|
+
sub32(:Time, :Ref, :Time)
|
473
|
+
|
474
|
+
call(:ShowResult, :Time)
|
475
|
+
end
|
476
|
+
|
477
|
+
sub :Test_SLEEP do
|
478
|
+
ui_draw(SCROLL, 8)
|
479
|
+
ui_draw(SELECT_FONT, TINY_FONT)
|
480
|
+
ui_draw(TEXT, FG_COLOR, 0, 120, "SLEEP() . . . . . . . . . . ")
|
481
|
+
ui_draw(UPDATE)
|
482
|
+
|
483
|
+
ui_write(PUT_STRING, " SLEEP()......................... ")
|
484
|
+
ui_flush
|
485
|
+
move32_32(0, :Counter)
|
486
|
+
timer_read_us(:Start)
|
487
|
+
|
488
|
+
loop_while lambda {
|
489
|
+
# TEST ***********************************************
|
490
|
+
self.sleep
|
491
|
+
# ****************************************************
|
492
|
+
add32(1, :Counter, :Counter)
|
493
|
+
}, Lt32.new(:Counter, TIMES)
|
494
|
+
|
495
|
+
timer_read_us(:Stop)
|
496
|
+
sub32(:Stop, :Start, :Time)
|
497
|
+
sub32(:Time, :Ref, :Time)
|
498
|
+
|
499
|
+
call(:ShowResult, :Time)
|
500
|
+
end
|
501
|
+
|
502
|
+
sub :Test_ui_draw_CLEAN do
|
503
|
+
ui_write(PUT_STRING, " UI_DRAW(FILLWINDOW,0,0,0)....... ")
|
504
|
+
ui_flush
|
505
|
+
move32_32(0, :Counter)
|
506
|
+
timer_read_us(:Start)
|
507
|
+
|
508
|
+
loop_while lambda {
|
509
|
+
# TEST ***********************************************
|
510
|
+
ui_draw(FILLWINDOW, 0, 0, 0)
|
511
|
+
# ****************************************************
|
512
|
+
add32(1, :Counter, :Counter)
|
513
|
+
}, Lt32.new(:Counter, TIMES)
|
514
|
+
|
515
|
+
timer_read_us(:Stop)
|
516
|
+
sub32(:Stop, :Start, :Time)
|
517
|
+
sub32(:Time, :Ref, :Time)
|
518
|
+
|
519
|
+
call(:ShowResult, :Time)
|
520
|
+
end
|
521
|
+
|
522
|
+
sub :Test_ui_draw_TEXT_10_aligned do
|
523
|
+
ui_write(PUT_STRING, " UI_DRAW(TEXT,1,0,0,\"0123456789\") ")
|
524
|
+
ui_flush
|
525
|
+
move32_32(0, :Counter)
|
526
|
+
timer_read_us(:Start)
|
527
|
+
|
528
|
+
loop_while lambda {
|
529
|
+
# TEST ***********************************************
|
530
|
+
ui_draw(TEXT, FG_COLOR, 0, 0, "0123456789")
|
531
|
+
# ****************************************************
|
532
|
+
add32(1, :Counter, :Counter)
|
533
|
+
}, Lt32.new(:Counter, TIMES)
|
534
|
+
|
535
|
+
timer_read_us(:Stop)
|
536
|
+
sub32(:Stop, :Start, :Time)
|
537
|
+
sub32(:Time, :Ref, :Time)
|
538
|
+
|
539
|
+
call(:ShowResult, :Time)
|
540
|
+
end
|
541
|
+
|
542
|
+
sub :Test_ui_draw_TEXT_10_not_aligned do
|
543
|
+
ui_write(PUT_STRING, " UI_DRAW(TEXT,1,3,0,\"0123456789\") ")
|
544
|
+
ui_flush
|
545
|
+
move32_32(0, :Counter)
|
546
|
+
timer_read_us(:Start)
|
547
|
+
|
548
|
+
loop_while lambda {
|
549
|
+
# TEST ***********************************************
|
550
|
+
ui_draw(TEXT, FG_COLOR, 3, 16, "0123456789")
|
551
|
+
# ****************************************************
|
552
|
+
add32(1, :Counter, :Counter)
|
553
|
+
}, Lt32.new(:Counter, TIMES)
|
554
|
+
|
555
|
+
timer_read_us(:Stop)
|
556
|
+
sub32(:Stop, :Start, :Time)
|
557
|
+
sub32(:Time, :Ref, :Time)
|
558
|
+
|
559
|
+
call(:ShowResult, :Time)
|
560
|
+
end
|
561
|
+
|
562
|
+
sub :Test_ui_draw_ICON do
|
563
|
+
ui_write(PUT_STRING, " UI_DRAW(ICON...)................ ")
|
564
|
+
ui_flush
|
565
|
+
move32_32(0, :Counter)
|
566
|
+
timer_read_us(:Start)
|
567
|
+
|
568
|
+
loop_while lambda {
|
569
|
+
# TEST ***********************************************
|
570
|
+
ui_draw(ICON, FG_COLOR, 0, 28, LARGE_ICON, WARNSIGN)
|
571
|
+
# ****************************************************
|
572
|
+
add32(1, :Counter, :Counter)
|
573
|
+
}, Lt32.new(:Counter, TIMES)
|
574
|
+
|
575
|
+
timer_read_us(:Stop)
|
576
|
+
sub32(:Stop, :Start, :Time)
|
577
|
+
sub32(:Time, :Ref, :Time)
|
578
|
+
|
579
|
+
call(:ShowResult, :Time)
|
580
|
+
end
|
581
|
+
|
582
|
+
sub :Test_ui_draw_BMPFILE do
|
583
|
+
ui_write(PUT_STRING, " UI_DRAW(BMPFILE...)............. ")
|
584
|
+
ui_flush
|
585
|
+
move32_32(0, :Counter)
|
586
|
+
timer_read_us(:Start)
|
587
|
+
|
588
|
+
loop_while lambda {
|
589
|
+
# TEST ***********************************************
|
590
|
+
ui_draw(BMPFILE, FG_COLOR, 16, 50, "144x65_POP3")
|
591
|
+
# ****************************************************
|
592
|
+
add32(1, :Counter, :Counter)
|
593
|
+
}, Lt32.new(:Counter, TIMES)
|
594
|
+
|
595
|
+
timer_read_us(:Stop)
|
596
|
+
sub32(:Stop, :Start, :Time)
|
597
|
+
sub32(:Time, :Ref, :Time)
|
598
|
+
|
599
|
+
call(:ShowResult, :Time)
|
600
|
+
end
|
601
|
+
|
602
|
+
sub :Test_ui_draw_RECT do
|
603
|
+
ui_write(PUT_STRING, " UI_DRAW(RECT...)................ ")
|
604
|
+
ui_flush
|
605
|
+
move32_32(0, :Counter)
|
606
|
+
timer_read_us(:Start)
|
607
|
+
|
608
|
+
loop_while lambda {
|
609
|
+
# TEST ***********************************************
|
610
|
+
ui_draw(RECT, FG_COLOR, 15, 49, 146, 67)
|
611
|
+
# ****************************************************
|
612
|
+
add32(1, :Counter, :Counter)
|
613
|
+
}, Lt32.new(:Counter, TIMES)
|
614
|
+
|
615
|
+
timer_read_us(:Stop)
|
616
|
+
sub32(:Stop, :Start, :Time)
|
617
|
+
sub32(:Time, :Ref, :Time)
|
618
|
+
|
619
|
+
call(:ShowResult, :Time)
|
620
|
+
end
|
621
|
+
|
622
|
+
sub :Test_ui_draw_PIXEL do
|
623
|
+
ui_write(PUT_STRING, " UI_DRAW(PIXEL...)............... ")
|
624
|
+
ui_flush
|
625
|
+
move32_32(0, :Counter)
|
626
|
+
timer_read_us(:Start)
|
627
|
+
|
628
|
+
loop_while lambda {
|
629
|
+
# TEST ***********************************************
|
630
|
+
ui_draw(PIXEL, FG_COLOR, 0, 120)
|
631
|
+
# ****************************************************
|
632
|
+
add32(1, :Counter, :Counter)
|
633
|
+
}, Lt32.new(:Counter, TIMES)
|
634
|
+
|
635
|
+
timer_read_us(:Stop)
|
636
|
+
sub32(:Stop, :Start, :Time)
|
637
|
+
sub32(:Time, :Ref, :Time)
|
638
|
+
|
639
|
+
call(:ShowResult, :Time)
|
640
|
+
end
|
641
|
+
|
642
|
+
sub :Test_ui_draw_UPDATE do
|
643
|
+
ui_write(PUT_STRING, " UI_DRAW(UPDATE)................. ")
|
644
|
+
ui_flush
|
645
|
+
move32_32(0, :Counter)
|
646
|
+
timer_read_us(:Start)
|
647
|
+
|
648
|
+
loop_while lambda {
|
649
|
+
# TEST ***********************************************
|
650
|
+
ui_draw(UPDATE)
|
651
|
+
# ****************************************************
|
652
|
+
add32(1, :Counter, :Counter)
|
653
|
+
}, Lt32.new(:Counter, TIMES)
|
654
|
+
|
655
|
+
timer_read_us(:Stop)
|
656
|
+
sub32(:Stop, :Start, :Time)
|
657
|
+
sub32(:Time, :Ref, :Time)
|
658
|
+
|
659
|
+
call(:ShowResult, :Time)
|
660
|
+
end
|
661
|
+
|
662
|
+
sub :ShowResult do
|
663
|
+
in32 :Timer
|
664
|
+
|
665
|
+
dataf :Tmp1
|
666
|
+
dataf :Tmp2
|
667
|
+
|
668
|
+
move32_f(:Timer, :Tmp1)
|
669
|
+
move32_f(MS, :Tmp2)
|
670
|
+
mulf(:Tmp1, :Tmp2, :Tmp1)
|
671
|
+
move32_f(TIMES, :Tmp2)
|
672
|
+
divf(:Tmp1, :Tmp2, :Tmp1)
|
673
|
+
ui_write(FLOATVALUE, :Tmp1, 6, 0)
|
674
|
+
ui_write(PUT_STRING, "\r\n")
|
675
|
+
ui_flush
|
676
|
+
|
677
|
+
ui_draw(SELECT_FONT, TINY_FONT)
|
678
|
+
ui_draw(VALUE, FG_COLOR, 145, 120, :Tmp1, 6, 0)
|
679
|
+
ui_draw(UPDATE)
|
680
|
+
end
|
681
|
+
|
682
|
+
sub :CallNoPar do
|
683
|
+
end
|
684
|
+
|
685
|
+
sub :Call4Par do
|
686
|
+
in32 :Data32_1
|
687
|
+
in32 :Data32_2
|
688
|
+
out32 :Data32_3
|
689
|
+
out32 :Data32_4
|
690
|
+
end
|