-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheasyrider.lst
More file actions
10665 lines (10664 loc) · 434 KB
/
Copy patheasyrider.lst
File metadata and controls
10665 lines (10664 loc) · 434 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1 .file "easyrider.c"
2 __SP_H__ = 0x3e
3 __SP_L__ = 0x3d
4 __SREG__ = 0x3f
5 __RAMPZ__ = 0x3b
6 __tmp_reg__ = 0
7 __zero_reg__ = 1
8 .text
9 .Ltext0:
10 .cfi_sections .debug_frame
11 .section .text.check_battery_read,"ax",@progbits
13 check_battery_read:
14 .LFB7:
15 .file 1 "easyrider.c"
1:easyrider.c **** /*
2:easyrider.c **** *
3:easyrider.c **** * Copyright (C) 2013 Bas Brugman
4:easyrider.c **** * http://www.visionnaire.nl
5:easyrider.c **** *
6:easyrider.c **** * Licensed under the Apache License, Version 2.0 (the "License");
7:easyrider.c **** * you may not use this file except in compliance with the License.
8:easyrider.c **** * You may obtain a copy of the License at
9:easyrider.c **** *
10:easyrider.c **** * http://www.apache.org/licenses/LICENSE-2.0
11:easyrider.c **** *
12:easyrider.c **** * Unless required by applicable law or agreed to in writing, software
13:easyrider.c **** * distributed under the License is distributed on an "AS IS" BASIS,
14:easyrider.c **** * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15:easyrider.c **** * See the License for the specific language governing permissions and
16:easyrider.c **** * limitations under the License.
17:easyrider.c **** *
18:easyrider.c **** */
19:easyrider.c **** #include <avr/io.h>
20:easyrider.c **** #include <avr/interrupt.h>
21:easyrider.c **** #include <avr/pgmspace.h>
22:easyrider.c **** #include <avr/eeprom.h>
23:easyrider.c **** #include <avr/wdt.h>
24:easyrider.c **** #include <avr/sleep.h>
25:easyrider.c **** #include <avr/power.h>
26:easyrider.c **** #include <stdlib.h>
27:easyrider.c **** #include <stdint.h>
28:easyrider.c **** #include <string.h>
29:easyrider.c ****
30:easyrider.c **** #include "command.h"
31:easyrider.c **** #include "usart.h"
32:easyrider.c **** #include "command_usart.h"
33:easyrider.c **** #include "command_handlers.h"
34:easyrider.c **** #include "easyrider.h"
35:easyrider.c ****
36:easyrider.c **** #include "sound/alarm.h"
37:easyrider.c **** #include "sound/frogger.h"
38:easyrider.c **** #include "sound/furelise.h"
39:easyrider.c **** #include "sound/larry.h"
40:easyrider.c **** #include "sound/pipi.h"
41:easyrider.c **** #include "sound/popcorn.h"
42:easyrider.c ****
43:easyrider.c **** // state transition struct array: handler assigment for state/event combo's
44:easyrider.c **** tTransition g_trans[] = {
45:easyrider.c **** {check_claxon_on, EV_CLAXON_ON, process_claxon_on},
46:easyrider.c **** {check_claxon_off, EV_CLAXON_OFF, process_claxon_off},
47:easyrider.c **** {check_ri_on, EV_RI_ON, process_ri_on},
48:easyrider.c **** {check_ri_off, EV_RI_OFF, process_ri_off},
49:easyrider.c **** {check_li_on, EV_LI_ON, process_li_on},
50:easyrider.c **** {check_li_off, EV_LI_OFF, process_li_off},
51:easyrider.c **** {check_ign_on, EV_IGN_ON, process_ign_on},
52:easyrider.c **** {check_ign_off, EV_IGN_OFF, process_ign_off},
53:easyrider.c **** {check_alarm_on, EV_ALARM_ON, process_alarm_on},
54:easyrider.c **** {check_alarm_off, EV_ALARM_OFF, process_alarm_off},
55:easyrider.c **** {check_brake_on, EV_BRAKE_ON, process_brake_on},
56:easyrider.c **** {check_brake_off, EV_BRAKE_OFF, process_brake_off},
57:easyrider.c **** {check_pilot_on, EV_PILOT_ON, process_pilot_on},
58:easyrider.c **** {check_pilot_off, EV_PILOT_OFF, process_pilot_off},
59:easyrider.c **** {check_light_on, EV_LIGHT_ON, process_light_on},
60:easyrider.c **** {check_light_off, EV_LIGHT_OFF, process_light_off},
61:easyrider.c **** {check_battery_read, EV_READ_BATT, process_battery},
62:easyrider.c **** {check_warning_on, EV_WARNING_ON, process_warning_on},
63:easyrider.c **** {check_warning_off, EV_WARNING_OFF, process_warning_off},
64:easyrider.c **** {check_backpedal_on, EV_BACKPEDAL, process_backpedal}
65:easyrider.c **** };
66:easyrider.c ****
67:easyrider.c **** static uint16_t get_substate(uint16_t st) {
68:easyrider.c **** return (g_state & st);
69:easyrider.c **** }
70:easyrider.c ****
71:easyrider.c **** static void set_substate(uint16_t st) {
72:easyrider.c **** g_state |= st;
73:easyrider.c **** }
74:easyrider.c ****
75:easyrider.c **** static void remove_substate(uint16_t st) {
76:easyrider.c **** g_state &= ~st;
77:easyrider.c **** }
78:easyrider.c ****
79:easyrider.c **** // Gets called from the main loop, reads all senses and puts them in the event queue.
80:easyrider.c **** // The complete queue is handled (emptied) in each main loop iteration in a FIFO way, so better
81:easyrider.c **** // put the higher priority events at the top, i.e. claxon sound is more important then indicator li
82:easyrider.c **** static void dispatch_events() {
83:easyrider.c **** check_brake();
84:easyrider.c **** check_claxon();
85:easyrider.c **** check_ri();
86:easyrider.c **** check_li();
87:easyrider.c **** check_light();
88:easyrider.c **** check_pilot();
89:easyrider.c **** check_ign();
90:easyrider.c **** check_settle();
91:easyrider.c **** check_sound();
92:easyrider.c **** check_alarm();
93:easyrider.c **** check_alarm_settle();
94:easyrider.c **** check_alarm_trigger();
95:easyrider.c **** check_battery();
96:easyrider.c **** check_warning();
97:easyrider.c **** check_sleep();
98:easyrider.c **** if (g_settings.backpedal) {
99:easyrider.c **** check_backpedal();
100:easyrider.c **** }
101:easyrider.c **** }
102:easyrider.c ****
103:easyrider.c **** uint8_t check_battery_read() {
16 .loc 1 103 0
17 .cfi_startproc
18 /* prologue: function */
19 /* frame size = 0 */
20 /* stack size = 0 */
21 .L__stack_usage = 0
104:easyrider.c **** return ((g_state & ~(ST_ALARM | ST_ALARM_SETTLE | ST_SETTLE | ST_SLEEP)) == g_state);
22 .loc 1 104 0
23 0000 2091 0000 lds r18,g_state
24 0004 3091 0000 lds r19,g_state+1
25 0008 4091 0000 lds r20,g_state
26 000c 5091 0000 lds r21,g_state+1
27 0010 2F7B andi r18,191
28 0012 387F andi r19,248
29 0014 81E0 ldi r24,lo8(1)
30 0016 2417 cp r18,r20
31 0018 3507 cpc r19,r21
32 001a 01F0 breq .L2
33 001c 80E0 ldi r24,0
34 .L2:
105:easyrider.c **** }
35 .loc 1 105 0
36 001e 0895 ret
37 .cfi_endproc
38 .LFE7:
40 .section .text.check_ri_on,"ax",@progbits
42 check_ri_on:
43 .LFB8:
106:easyrider.c ****
107:easyrider.c **** uint8_t check_ri_on() {
44 .loc 1 107 0
45 .cfi_startproc
46 /* prologue: function */
47 /* frame size = 0 */
48 /* stack size = 0 */
49 .L__stack_usage = 0
108:easyrider.c **** return (((g_state & (ST_NORMAL | ST_RI | ST_CLAXON | ST_BRAKE | ST_LIGHT | ST_PILOT)) == g_state)
50 .loc 1 108 0
51 0000 8091 0000 lds r24,g_state
52 0004 9091 0000 lds r25,g_state+1
53 0008 2091 0000 lds r18,g_state
54 000c 3091 0000 lds r19,g_state+1
55 0010 8B7B andi r24,187
56 0012 9927 clr r25
57 0014 8217 cp r24,r18
58 0016 9307 cpc r25,r19
59 0018 01F0 breq .L8
60 001a 80E0 ldi r24,0
61 .L5:
109:easyrider.c **** ((g_state & ~(ST_LI | ST_ALARM | ST_ALARM_SETTLE | ST_SETTLE | ST_WARNING | ST_SLEEP)) == g
110:easyrider.c **** }
62 .loc 1 110 0 discriminator 4
63 001c 0895 ret
64 .L8:
109:easyrider.c **** ((g_state & ~(ST_LI | ST_ALARM | ST_ALARM_SETTLE | ST_SETTLE | ST_WARNING | ST_SLEEP)) == g
65 .loc 1 109 0 discriminator 1
66 001e 2091 0000 lds r18,g_state
67 0022 3091 0000 lds r19,g_state+1
68 0026 4091 0000 lds r20,g_state
69 002a 5091 0000 lds r21,g_state+1
70 002e 2B7B andi r18,187
71 0030 307F andi r19,240
108:easyrider.c **** return (((g_state & (ST_NORMAL | ST_RI | ST_CLAXON | ST_BRAKE | ST_LIGHT | ST_PILOT)) == g_state)
72 .loc 1 108 0 discriminator 1
73 0032 81E0 ldi r24,lo8(1)
74 0034 2417 cp r18,r20
75 0036 3507 cpc r19,r21
76 0038 01F0 breq .L5
77 003a 80E0 ldi r24,0
78 003c 00C0 rjmp .L5
79 .cfi_endproc
80 .LFE8:
82 .section .text.check_li_on,"ax",@progbits
84 check_li_on:
85 .LFB9:
111:easyrider.c ****
112:easyrider.c **** uint8_t check_li_on() {
86 .loc 1 112 0
87 .cfi_startproc
88 /* prologue: function */
89 /* frame size = 0 */
90 /* stack size = 0 */
91 .L__stack_usage = 0
113:easyrider.c **** return (((g_state & (ST_NORMAL | ST_LI | ST_CLAXON | ST_BRAKE | ST_LIGHT | ST_PILOT)) == g_state)
92 .loc 1 113 0
93 0000 8091 0000 lds r24,g_state
94 0004 9091 0000 lds r25,g_state+1
95 0008 2091 0000 lds r18,g_state
96 000c 3091 0000 lds r19,g_state+1
97 0010 8D7B andi r24,189
98 0012 9927 clr r25
99 0014 8217 cp r24,r18
100 0016 9307 cpc r25,r19
101 0018 01F0 breq .L13
102 001a 80E0 ldi r24,0
103 .L10:
114:easyrider.c **** ((g_state & ~(ST_RI | ST_ALARM | ST_ALARM_SETTLE | ST_SETTLE | ST_WARNING | ST_SLEEP)) == g
115:easyrider.c **** }
104 .loc 1 115 0 discriminator 4
105 001c 0895 ret
106 .L13:
114:easyrider.c **** ((g_state & ~(ST_RI | ST_ALARM | ST_ALARM_SETTLE | ST_SETTLE | ST_WARNING | ST_SLEEP)) == g
107 .loc 1 114 0 discriminator 1
108 001e 2091 0000 lds r18,g_state
109 0022 3091 0000 lds r19,g_state+1
110 0026 4091 0000 lds r20,g_state
111 002a 5091 0000 lds r21,g_state+1
112 002e 2D7B andi r18,189
113 0030 307F andi r19,240
113:easyrider.c **** return (((g_state & (ST_NORMAL | ST_LI | ST_CLAXON | ST_BRAKE | ST_LIGHT | ST_PILOT)) == g_state)
114 .loc 1 113 0 discriminator 1
115 0032 81E0 ldi r24,lo8(1)
116 0034 2417 cp r18,r20
117 0036 3507 cpc r19,r21
118 0038 01F0 breq .L10
119 003a 80E0 ldi r24,0
120 003c 00C0 rjmp .L10
121 .cfi_endproc
122 .LFE9:
124 .section .text.check_brake_on,"ax",@progbits
126 check_brake_on:
127 .LFB10:
116:easyrider.c ****
117:easyrider.c **** uint8_t check_brake_on() {
128 .loc 1 117 0
129 .cfi_startproc
130 /* prologue: function */
131 /* frame size = 0 */
132 /* stack size = 0 */
133 .L__stack_usage = 0
118:easyrider.c **** return (((g_state & (ST_NORMAL | ST_RI | ST_LI | ST_CLAXON | ST_LIGHT | ST_PILOT | ST_WARNING)) =
134 .loc 1 118 0
135 0000 8091 0000 lds r24,g_state
136 0004 9091 0000 lds r25,g_state+1
137 0008 2091 0000 lds r18,g_state
138 000c 3091 0000 lds r19,g_state+1
139 0010 8F7A andi r24,175
140 0012 9870 andi r25,8
141 0014 8217 cp r24,r18
142 0016 9307 cpc r25,r19
143 0018 01F0 breq .L18
144 001a 80E0 ldi r24,0
145 .L15:
119:easyrider.c **** ((g_state & ~(ST_BRAKE | ST_ALARM | ST_ALARM_SETTLE | ST_SETTLE | ST_SLEEP)) == g_state));
120:easyrider.c **** }
146 .loc 1 120 0 discriminator 4
147 001c 0895 ret
148 .L18:
119:easyrider.c **** ((g_state & ~(ST_BRAKE | ST_ALARM | ST_ALARM_SETTLE | ST_SETTLE | ST_SLEEP)) == g_state));
149 .loc 1 119 0 discriminator 1
150 001e 2091 0000 lds r18,g_state
151 0022 3091 0000 lds r19,g_state+1
152 0026 4091 0000 lds r20,g_state
153 002a 5091 0000 lds r21,g_state+1
154 002e 2F7A andi r18,175
155 0030 387F andi r19,248
118:easyrider.c **** return (((g_state & (ST_NORMAL | ST_RI | ST_LI | ST_CLAXON | ST_LIGHT | ST_PILOT | ST_WARNING)) =
156 .loc 1 118 0 discriminator 1
157 0032 81E0 ldi r24,lo8(1)
158 0034 2417 cp r18,r20
159 0036 3507 cpc r19,r21
160 0038 01F0 breq .L15
161 003a 80E0 ldi r24,0
162 003c 00C0 rjmp .L15
163 .cfi_endproc
164 .LFE10:
166 .section .text.check_warning_on,"ax",@progbits
168 check_warning_on:
169 .LFB11:
121:easyrider.c ****
122:easyrider.c **** uint8_t check_warning_on() {
170 .loc 1 122 0
171 .cfi_startproc
172 /* prologue: function */
173 /* frame size = 0 */
174 /* stack size = 0 */
175 .L__stack_usage = 0
123:easyrider.c **** // warning blinks override RI/LI
124:easyrider.c **** return (((g_state & (ST_NORMAL | ST_WARNING | ST_RI | ST_LI | ST_CLAXON | ST_LIGHT | ST_PILOT | S
176 .loc 1 124 0
177 0000 8091 0000 lds r24,g_state
178 0004 9091 0000 lds r25,g_state+1
179 0008 2091 0000 lds r18,g_state
180 000c 3091 0000 lds r19,g_state+1
181 0010 8F7B andi r24,191
182 0012 9870 andi r25,8
183 0014 8217 cp r24,r18
184 0016 9307 cpc r25,r19
185 0018 01F0 breq .L23
186 001a 80E0 ldi r24,0
187 .L20:
125:easyrider.c **** ((g_state & ~(ST_ALARM | ST_ALARM_SETTLE | ST_SETTLE | ST_SLEEP)) == g_state));
126:easyrider.c **** }
188 .loc 1 126 0 discriminator 4
189 001c 0895 ret
190 .L23:
125:easyrider.c **** ((g_state & ~(ST_ALARM | ST_ALARM_SETTLE | ST_SETTLE | ST_SLEEP)) == g_state));
191 .loc 1 125 0 discriminator 1
192 001e 2091 0000 lds r18,g_state
193 0022 3091 0000 lds r19,g_state+1
194 0026 4091 0000 lds r20,g_state
195 002a 5091 0000 lds r21,g_state+1
196 002e 2F7B andi r18,191
197 0030 387F andi r19,248
124:easyrider.c **** return (((g_state & (ST_NORMAL | ST_WARNING | ST_RI | ST_LI | ST_CLAXON | ST_LIGHT | ST_PILOT | S
198 .loc 1 124 0 discriminator 1
199 0032 81E0 ldi r24,lo8(1)
200 0034 2417 cp r18,r20
201 0036 3507 cpc r19,r21
202 0038 01F0 breq .L20
203 003a 80E0 ldi r24,0
204 003c 00C0 rjmp .L20
205 .cfi_endproc
206 .LFE11:
208 .section .text.check_pilot_on,"ax",@progbits
210 check_pilot_on:
211 .LFB12:
127:easyrider.c ****
128:easyrider.c **** uint8_t check_pilot_on() {
212 .loc 1 128 0
213 .cfi_startproc
214 /* prologue: function */
215 /* frame size = 0 */
216 /* stack size = 0 */
217 .L__stack_usage = 0
129:easyrider.c **** return (((g_state & (ST_NORMAL | ST_RI | ST_LI | ST_CLAXON | ST_LIGHT | ST_BRAKE | ST_WARNING)) =
218 .loc 1 129 0
219 0000 8091 0000 lds r24,g_state
220 0004 9091 0000 lds r25,g_state+1
221 0008 2091 0000 lds r18,g_state
222 000c 3091 0000 lds r19,g_state+1
223 0010 8F73 andi r24,63
224 0012 9870 andi r25,8
225 0014 8217 cp r24,r18
226 0016 9307 cpc r25,r19
227 0018 01F0 breq .L28
228 001a 80E0 ldi r24,0
229 .L25:
130:easyrider.c **** ((g_state & ~(ST_PILOT | ST_ALARM | ST_ALARM_SETTLE | ST_SETTLE | ST_SLEEP)) == g_state));
131:easyrider.c **** }
230 .loc 1 131 0 discriminator 4
231 001c 0895 ret
232 .L28:
130:easyrider.c **** ((g_state & ~(ST_PILOT | ST_ALARM | ST_ALARM_SETTLE | ST_SETTLE | ST_SLEEP)) == g_state));
233 .loc 1 130 0 discriminator 1
234 001e 2091 0000 lds r18,g_state
235 0022 3091 0000 lds r19,g_state+1
236 0026 4091 0000 lds r20,g_state
237 002a 5091 0000 lds r21,g_state+1
238 002e 2F73 andi r18,63
239 0030 387F andi r19,248
129:easyrider.c **** return (((g_state & (ST_NORMAL | ST_RI | ST_LI | ST_CLAXON | ST_LIGHT | ST_BRAKE | ST_WARNING)) =
240 .loc 1 129 0 discriminator 1
241 0032 81E0 ldi r24,lo8(1)
242 0034 2417 cp r18,r20
243 0036 3507 cpc r19,r21
244 0038 01F0 breq .L25
245 003a 80E0 ldi r24,0
246 003c 00C0 rjmp .L25
247 .cfi_endproc
248 .LFE12:
250 .section .text.check_light_on,"ax",@progbits
252 check_light_on:
253 .LFB13:
132:easyrider.c ****
133:easyrider.c **** uint8_t check_light_on() {
254 .loc 1 133 0
255 .cfi_startproc
256 /* prologue: function */
257 /* frame size = 0 */
258 /* stack size = 0 */
259 .L__stack_usage = 0
134:easyrider.c **** return (((g_state & (ST_NORMAL | ST_RI | ST_LI | ST_CLAXON | ST_PILOT | ST_BRAKE | ST_WARNING)) =
260 .loc 1 134 0
261 0000 8091 0000 lds r24,g_state
262 0004 9091 0000 lds r25,g_state+1
263 0008 2091 0000 lds r18,g_state
264 000c 3091 0000 lds r19,g_state+1
265 0010 8F79 andi r24,159
266 0012 9870 andi r25,8
267 0014 8217 cp r24,r18
268 0016 9307 cpc r25,r19
269 0018 01F0 breq .L33
270 001a 80E0 ldi r24,0
271 .L30:
135:easyrider.c **** ((g_state & ~(ST_LIGHT | ST_ALARM | ST_ALARM_SETTLE | ST_SETTLE | ST_SLEEP)) == g_state));
136:easyrider.c **** }
272 .loc 1 136 0 discriminator 4
273 001c 0895 ret
274 .L33:
135:easyrider.c **** ((g_state & ~(ST_LIGHT | ST_ALARM | ST_ALARM_SETTLE | ST_SETTLE | ST_SLEEP)) == g_state));
275 .loc 1 135 0 discriminator 1
276 001e 2091 0000 lds r18,g_state
277 0022 3091 0000 lds r19,g_state+1
278 0026 4091 0000 lds r20,g_state
279 002a 5091 0000 lds r21,g_state+1
280 002e 2F79 andi r18,159
281 0030 387F andi r19,248
134:easyrider.c **** return (((g_state & (ST_NORMAL | ST_RI | ST_LI | ST_CLAXON | ST_PILOT | ST_BRAKE | ST_WARNING)) =
282 .loc 1 134 0 discriminator 1
283 0032 81E0 ldi r24,lo8(1)
284 0034 2417 cp r18,r20
285 0036 3507 cpc r19,r21
286 0038 01F0 breq .L30
287 003a 80E0 ldi r24,0
288 003c 00C0 rjmp .L30
289 .cfi_endproc
290 .LFE13:
292 .section .text.check_backpedal_on,"ax",@progbits
294 check_backpedal_on:
295 .LFB14:
137:easyrider.c ****
138:easyrider.c **** uint8_t check_backpedal_on() {
296 .loc 1 138 0
297 .cfi_startproc
298 /* prologue: function */
299 /* frame size = 0 */
300 /* stack size = 0 */
301 .L__stack_usage = 0
139:easyrider.c **** return (((g_state & (ST_NORMAL | ST_LIGHT | ST_CLAXON | ST_PILOT | ST_BRAKE )) == g_state) &&
302 .loc 1 139 0
303 0000 8091 0000 lds r24,g_state
304 0004 9091 0000 lds r25,g_state+1
305 0008 2091 0000 lds r18,g_state
306 000c 3091 0000 lds r19,g_state+1
307 0010 897B andi r24,185
308 0012 9927 clr r25
309 0014 8217 cp r24,r18
310 0016 9307 cpc r25,r19
311 0018 01F0 breq .L38
312 001a 80E0 ldi r24,0
313 .L35:
140:easyrider.c **** ((g_state & ~(ST_WARNING | ST_RI | ST_LI | ST_ALARM | ST_ALARM_SETTLE | ST_SETTLE | ST_SLEE
141:easyrider.c **** }
314 .loc 1 141 0 discriminator 4
315 001c 0895 ret
316 .L38:
140:easyrider.c **** ((g_state & ~(ST_WARNING | ST_RI | ST_LI | ST_ALARM | ST_ALARM_SETTLE | ST_SETTLE | ST_SLEE
317 .loc 1 140 0 discriminator 1
318 001e 2091 0000 lds r18,g_state
319 0022 3091 0000 lds r19,g_state+1
320 0026 4091 0000 lds r20,g_state
321 002a 5091 0000 lds r21,g_state+1
322 002e 297B andi r18,185
323 0030 307F andi r19,240
139:easyrider.c **** return (((g_state & (ST_NORMAL | ST_LIGHT | ST_CLAXON | ST_PILOT | ST_BRAKE )) == g_state) &&
324 .loc 1 139 0 discriminator 1
325 0032 81E0 ldi r24,lo8(1)
326 0034 2417 cp r18,r20
327 0036 3507 cpc r19,r21
328 0038 01F0 breq .L35
329 003a 80E0 ldi r24,0
330 003c 00C0 rjmp .L35
331 .cfi_endproc
332 .LFE14:
334 .section .text.check_claxon_on,"ax",@progbits
336 check_claxon_on:
337 .LFB15:
142:easyrider.c ****
143:easyrider.c **** uint8_t check_claxon_on() {
338 .loc 1 143 0
339 .cfi_startproc
340 /* prologue: function */
341 /* frame size = 0 */
342 /* stack size = 0 */
343 .L__stack_usage = 0
144:easyrider.c **** return (((g_state & (ST_NORMAL | ST_RI | ST_LI | ST_BRAKE | ST_LIGHT | ST_PILOT | ST_WARNING)) ==
344 .loc 1 144 0
345 0000 8091 0000 lds r24,g_state
346 0004 9091 0000 lds r25,g_state+1
347 0008 2091 0000 lds r18,g_state
348 000c 3091 0000 lds r19,g_state+1
349 0010 877B andi r24,183
350 0012 9870 andi r25,8
351 0014 8217 cp r24,r18
352 0016 9307 cpc r25,r19
353 0018 01F0 breq .L43
354 001a 80E0 ldi r24,0
355 .L40:
145:easyrider.c **** ((g_state & ~(ST_CLAXON | ST_ALARM | ST_ALARM_SETTLE | ST_SETTLE | ST_SLEEP)) == g_state));
146:easyrider.c **** }
356 .loc 1 146 0 discriminator 4
357 001c 0895 ret
358 .L43:
145:easyrider.c **** ((g_state & ~(ST_CLAXON | ST_ALARM | ST_ALARM_SETTLE | ST_SETTLE | ST_SLEEP)) == g_state));
359 .loc 1 145 0 discriminator 1
360 001e 2091 0000 lds r18,g_state
361 0022 3091 0000 lds r19,g_state+1
362 0026 4091 0000 lds r20,g_state
363 002a 5091 0000 lds r21,g_state+1
364 002e 277B andi r18,183
365 0030 387F andi r19,248
144:easyrider.c **** return (((g_state & (ST_NORMAL | ST_RI | ST_LI | ST_BRAKE | ST_LIGHT | ST_PILOT | ST_WARNING)) ==
366 .loc 1 144 0 discriminator 1
367 0032 81E0 ldi r24,lo8(1)
368 0034 2417 cp r18,r20
369 0036 3507 cpc r19,r21
370 0038 01F0 breq .L40
371 003a 80E0 ldi r24,0
372 003c 00C0 rjmp .L40
373 .cfi_endproc
374 .LFE15:
376 .section .text.check_ign_on,"ax",@progbits
378 check_ign_on:
379 .LFB16:
147:easyrider.c ****
148:easyrider.c **** uint8_t check_ign_on() {
380 .loc 1 148 0
381 .cfi_startproc
382 /* prologue: function */
383 /* frame size = 0 */
384 /* stack size = 0 */
385 .L__stack_usage = 0
149:easyrider.c **** return ((g_state & (ST_SLEEP | ST_ALARM_SETTLE | ST_ALARM)) == g_state);
386 .loc 1 149 0
387 0000 2091 0000 lds r18,g_state
388 0004 3091 0000 lds r19,g_state+1
389 0008 4091 0000 lds r20,g_state
390 000c 5091 0000 lds r21,g_state+1
391 0010 2074 andi r18,64
392 0012 3370 andi r19,3
393 0014 81E0 ldi r24,lo8(1)
394 0016 2417 cp r18,r20
395 0018 3507 cpc r19,r21
396 001a 01F0 breq .L45
397 001c 80E0 ldi r24,0
398 .L45:
150:easyrider.c **** }
399 .loc 1 150 0
400 001e 0895 ret
401 .cfi_endproc
402 .LFE16:
404 .section .text.check_alarm_on,"ax",@progbits
406 check_alarm_on:
407 .LFB17:
151:easyrider.c ****
152:easyrider.c **** uint8_t check_alarm_on() {
408 .loc 1 152 0
409 .cfi_startproc
410 /* prologue: function */
411 /* frame size = 0 */
412 /* stack size = 0 */
413 .L__stack_usage = 0
153:easyrider.c **** //BUG: change this..
154:easyrider.c **** return ((g_state & ST_SLEEP) == g_state);
414 .loc 1 154 0
415 0000 2091 0000 lds r18,g_state
416 0004 3091 0000 lds r19,g_state+1
417 0008 4091 0000 lds r20,g_state
418 000c 5091 0000 lds r21,g_state+1
419 0010 2227 clr r18
420 0012 3270 andi r19,2
421 0014 81E0 ldi r24,lo8(1)
422 0016 2417 cp r18,r20
423 0018 3507 cpc r19,r21
424 001a 01F0 breq .L47
425 001c 80E0 ldi r24,0
426 .L47:
155:easyrider.c **** }
427 .loc 1 155 0
428 001e 0895 ret
429 .cfi_endproc
430 .LFE17:
432 .section .text.check_ri_off,"ax",@progbits
434 check_ri_off:
435 .LFB18:
156:easyrider.c ****
157:easyrider.c **** uint8_t check_ri_off() {
436 .loc 1 157 0
437 .cfi_startproc
438 /* prologue: function */
439 /* frame size = 0 */
440 /* stack size = 0 */
441 .L__stack_usage = 0
158:easyrider.c **** return ((ST_RI & g_state) == ST_RI);
442 .loc 1 158 0
443 0000 8091 0000 lds r24,g_state
444 0004 9091 0000 lds r25,g_state+1
445 0008 9695 lsr r25
446 000a 8795 ror r24
159:easyrider.c **** }
447 .loc 1 159 0
448 000c 8170 andi r24,lo8(1)
449 000e 0895 ret
450 .cfi_endproc
451 .LFE18:
453 .section .text.check_li_off,"ax",@progbits
455 check_li_off:
456 .LFB19:
160:easyrider.c ****
161:easyrider.c **** uint8_t check_li_off() {
457 .loc 1 161 0
458 .cfi_startproc
459 /* prologue: function */
460 /* frame size = 0 */
461 /* stack size = 0 */
462 .L__stack_usage = 0
162:easyrider.c **** return ((ST_LI & g_state) == ST_LI);
463 .loc 1 162 0
464 0000 8091 0000 lds r24,g_state
465 0004 9091 0000 lds r25,g_state+1
466 0008 9695 lsr r25
467 000a 8795 ror r24
468 000c 9695 lsr r25
469 000e 8795 ror r24
163:easyrider.c **** }
470 .loc 1 163 0
471 0010 8170 andi r24,lo8(1)
472 0012 0895 ret
473 .cfi_endproc
474 .LFE19:
476 .section .text.check_claxon_off,"ax",@progbits
478 check_claxon_off:
479 .LFB20:
164:easyrider.c ****
165:easyrider.c **** uint8_t check_claxon_off() {
480 .loc 1 165 0
481 .cfi_startproc
482 /* prologue: function */
483 /* frame size = 0 */
484 /* stack size = 0 */
485 .L__stack_usage = 0
166:easyrider.c **** return ((ST_CLAXON & g_state) == ST_CLAXON);
486 .loc 1 166 0
487 0000 8091 0000 lds r24,g_state
488 0004 9091 0000 lds r25,g_state+1
489 0008 9695 lsr r25
490 000a 8795 ror r24
491 000c 9695 lsr r25
492 000e 8795 ror r24
493 0010 9695 lsr r25
494 0012 8795 ror r24
167:easyrider.c **** }
495 .loc 1 167 0
496 0014 8170 andi r24,lo8(1)
497 0016 0895 ret
498 .cfi_endproc
499 .LFE20:
501 .section .text.check_pilot_off,"ax",@progbits
503 check_pilot_off:
504 .LFB21:
168:easyrider.c ****
169:easyrider.c **** uint8_t check_pilot_off() {
505 .loc 1 169 0
506 .cfi_startproc
507 /* prologue: function */
508 /* frame size = 0 */
509 /* stack size = 0 */
510 .L__stack_usage = 0
170:easyrider.c **** return ((ST_PILOT & g_state) == ST_PILOT);
511 .loc 1 170 0
512 0000 8091 0000 lds r24,g_state
513 0004 9091 0000 lds r25,g_state+1
514 0008 880F lsl r24
515 000a 892F mov r24,r25
516 000c 881F rol r24
517 000e 990B sbc r25,r25
518 0010 9195 neg r25
171:easyrider.c **** }
519 .loc 1 171 0
520 0012 8170 andi r24,lo8(1)
521 0014 0895 ret
522 .cfi_endproc
523 .LFE21:
525 .section .text.check_brake_off,"ax",@progbits
527 check_brake_off:
528 .LFB22:
172:easyrider.c ****
173:easyrider.c **** uint8_t check_brake_off() {
529 .loc 1 173 0
530 .cfi_startproc
531 /* prologue: function */
532 /* frame size = 0 */
533 /* stack size = 0 */
534 .L__stack_usage = 0
174:easyrider.c **** return ((ST_BRAKE & g_state) == ST_BRAKE);
535 .loc 1 174 0
536 0000 8091 0000 lds r24,g_state
537 0004 9091 0000 lds r25,g_state+1
538 0008 9295 swap r25
539 000a 8295 swap r24
540 000c 8F70 andi r24,0x0f
541 000e 8927 eor r24,r25
542 0010 9F70 andi r25,0x0f
543 0012 8927 eor r24,r25
175:easyrider.c **** }
544 .loc 1 175 0
545 0014 8170 andi r24,lo8(1)
546 0016 0895 ret
547 .cfi_endproc
548 .LFE22:
550 .section .text.check_warning_off,"ax",@progbits
552 check_warning_off:
553 .LFB23:
176:easyrider.c ****
177:easyrider.c **** uint8_t check_warning_off() {
554 .loc 1 177 0
555 .cfi_startproc
556 /* prologue: function */
557 /* frame size = 0 */
558 /* stack size = 0 */
559 .L__stack_usage = 0
178:easyrider.c **** return ((ST_WARNING & g_state) == ST_WARNING);
560 .loc 1 178 0
561 0000 8091 0000 lds r24,g_state
562 0004 9091 0000 lds r25,g_state+1
179:easyrider.c **** }
563 .loc 1 179 0
564 0008 93FB bst r25,3
565 000a 8827 clr r24
566 000c 80F9 bld r24,0
567 000e 0895 ret
568 .cfi_endproc
569 .LFE23:
571 .section .text.check_light_off,"ax",@progbits
573 check_light_off:
574 .LFB24:
180:easyrider.c ****
181:easyrider.c **** uint8_t check_light_off() {
575 .loc 1 181 0
576 .cfi_startproc
577 /* prologue: function */
578 /* frame size = 0 */
579 /* stack size = 0 */
580 .L__stack_usage = 0
182:easyrider.c **** return ((ST_LIGHT & g_state) == ST_LIGHT);
581 .loc 1 182 0
582 0000 8091 0000 lds r24,g_state
583 0004 9091 0000 lds r25,g_state+1
584 0008 9695 lsr r25
585 000a 8795 ror r24
586 000c 9295 swap r25
587 000e 8295 swap r24
588 0010 8F70 andi r24,0x0f
589 0012 8927 eor r24,r25
590 0014 9F70 andi r25,0x0f
591 0016 8927 eor r24,r25
183:easyrider.c **** }
592 .loc 1 183 0
593 0018 8170 andi r24,lo8(1)
594 001a 0895 ret
595 .cfi_endproc
596 .LFE24:
598 .section .text.check_ign_off,"ax",@progbits
600 check_ign_off:
601 .LFB25:
184:easyrider.c ****
185:easyrider.c **** uint8_t check_ign_off() {
602 .loc 1 185 0
603 .cfi_startproc
604 /* prologue: function */
605 /* frame size = 0 */
606 /* stack size = 0 */
607 .L__stack_usage = 0
186:easyrider.c **** return ((g_state & ~(ST_SLEEP | ST_ALARM | ST_ALARM_SETTLE)) == g_state);
608 .loc 1 186 0
609 0000 2091 0000 lds r18,g_state
610 0004 3091 0000 lds r19,g_state+1
611 0008 4091 0000 lds r20,g_state
612 000c 5091 0000 lds r21,g_state+1
613 0010 2F7B andi r18,191
614 0012 3C7F andi r19,252
615 0014 81E0 ldi r24,lo8(1)
616 0016 2417 cp r18,r20
617 0018 3507 cpc r19,r21
618 001a 01F0 breq .L56
619 001c 80E0 ldi r24,0
620 .L56:
187:easyrider.c **** }
621 .loc 1 187 0
622 001e 0895 ret
623 .cfi_endproc
624 .LFE25:
626 .section .text.check_alarm_off,"ax",@progbits
628 check_alarm_off:
629 .LFB26:
188:easyrider.c ****
189:easyrider.c **** uint8_t check_alarm_off() {
630 .loc 1 189 0
631 .cfi_startproc
632 /* prologue: function */
633 /* frame size = 0 */
634 /* stack size = 0 */
635 .L__stack_usage = 0
190:easyrider.c **** // alarm can't be switched off in alarm state, only explicitly in alarm_settle mode
191:easyrider.c **** // or automatically when ignition is switched on
192:easyrider.c **** return ((g_state & (ST_ALARM_SETTLE)) == g_state);
636 .loc 1 192 0
637 0000 2091 0000 lds r18,g_state
638 0004 3091 0000 lds r19,g_state+1
639 0008 4091 0000 lds r20,g_state
640 000c 5091 0000 lds r21,g_state+1
641 0010 2227 clr r18
642 0012 3170 andi r19,1
643 0014 81E0 ldi r24,lo8(1)
644 0016 2417 cp r18,r20
645 0018 3507 cpc r19,r21
646 001a 01F0 breq .L58
647 001c 80E0 ldi r24,0
648 .L58:
193:easyrider.c **** }
649 .loc 1 193 0
650 001e 0895 ret
651 .cfi_endproc
652 .LFE26:
654 .section .text.reset_ports,"ax",@progbits
656 reset_ports:
657 .LFB65:
194:easyrider.c ****
195:easyrider.c **** void check_ri() {
196:easyrider.c **** // pin senses
197:easyrider.c **** if ((g_senses & FLAG_SENSE_LIGHT_RI) == FLAG_SENSE_LIGHT_RI) {
198:easyrider.c **** if (~STATUS_C90_SENSE_LIGHT_RI) { // low, RI on
199:easyrider.c **** set_event(EV_RI_ON);
200:easyrider.c **** }
201:easyrider.c **** if (STATUS_C90_SENSE_LIGHT_RI) { // RI off
202:easyrider.c **** set_event(EV_RI_OFF);
203:easyrider.c **** }
204:easyrider.c **** }
205:easyrider.c **** // dynamic senses
206:easyrider.c **** if ((g_dyn_senses & FLAG_SENSE_LIGHT_RI) == FLAG_SENSE_LIGHT_RI) {
207:easyrider.c **** if ((g_dyn_senses_status & FLAG_SENSE_LIGHT_RI) == FLAG_SENSE_LIGHT_RI) { // high, RI off
208:easyrider.c **** set_event(EV_RI_OFF);
209:easyrider.c **** } else {
210:easyrider.c **** set_event(EV_RI_ON); // RI on
211:easyrider.c **** }
212:easyrider.c **** }
213:easyrider.c **** }
214:easyrider.c ****
215:easyrider.c **** void check_li() {
216:easyrider.c **** // pin senses
217:easyrider.c **** if ((g_senses & FLAG_SENSE_LIGHT_LI) == FLAG_SENSE_LIGHT_LI) {
218:easyrider.c **** if (~STATUS_C90_SENSE_LIGHT_LI) { // low, LI on
219:easyrider.c **** set_event(EV_LI_ON);
220:easyrider.c **** }
221:easyrider.c **** if (STATUS_C90_SENSE_LIGHT_LI) { // LI off
222:easyrider.c **** set_event(EV_LI_OFF);
223:easyrider.c **** }
224:easyrider.c **** }
225:easyrider.c **** // dynamic senses
226:easyrider.c **** if ((g_dyn_senses & FLAG_SENSE_LIGHT_LI) == FLAG_SENSE_LIGHT_LI) {
227:easyrider.c **** if ((g_dyn_senses_status & FLAG_SENSE_LIGHT_LI) == FLAG_SENSE_LIGHT_LI) { // high, LI off
228:easyrider.c **** set_event(EV_LI_OFF);
229:easyrider.c **** } else {
230:easyrider.c **** set_event(EV_LI_ON); // LI on
231:easyrider.c **** }
232:easyrider.c **** }
233:easyrider.c **** }
234:easyrider.c ****
235:easyrider.c **** void check_claxon() {
236:easyrider.c **** // pin senses
237:easyrider.c **** if ((g_senses & FLAG_SENSE_CLAXON) == FLAG_SENSE_CLAXON) {
238:easyrider.c **** if (~STATUS_C90_SENSE_CLAXON) {
239:easyrider.c **** set_event(EV_CLAXON_ON);
240:easyrider.c **** }
241:easyrider.c **** if (STATUS_C90_SENSE_CLAXON) {
242:easyrider.c **** set_event(EV_CLAXON_OFF);
243:easyrider.c **** }
244:easyrider.c **** }
245:easyrider.c **** // dynamic senses
246:easyrider.c **** if ((g_dyn_senses & FLAG_SENSE_CLAXON) == FLAG_SENSE_CLAXON) {
247:easyrider.c **** if ((g_dyn_senses_status & FLAG_SENSE_CLAXON) == FLAG_SENSE_CLAXON) {
248:easyrider.c **** set_event(EV_CLAXON_OFF);
249:easyrider.c **** } else {
250:easyrider.c **** set_event(EV_CLAXON_ON);
251:easyrider.c **** }
252:easyrider.c **** }
253:easyrider.c **** }
254:easyrider.c ****
255:easyrider.c **** void check_pilot() {
256:easyrider.c **** // pin senses
257:easyrider.c **** if ((g_senses & FLAG_SENSE_PILOT) == FLAG_SENSE_PILOT) {
258:easyrider.c **** if (~STATUS_C90_SENSE_PILOT) {
259:easyrider.c **** set_event(EV_PILOT_ON);
260:easyrider.c **** }
261:easyrider.c **** if (STATUS_C90_SENSE_PILOT) {
262:easyrider.c **** set_event(EV_PILOT_OFF);
263:easyrider.c **** }
264:easyrider.c **** }
265:easyrider.c **** // dynamic senses
266:easyrider.c **** if ((g_dyn_senses & FLAG_SENSE_PILOT) == FLAG_SENSE_PILOT) {
267:easyrider.c **** if ((g_dyn_senses_status & FLAG_SENSE_PILOT) == FLAG_SENSE_PILOT) {
268:easyrider.c **** set_event(EV_PILOT_OFF);
269:easyrider.c **** } else {
270:easyrider.c **** set_event(EV_PILOT_ON);
271:easyrider.c **** }
272:easyrider.c **** }
273:easyrider.c **** }
274:easyrider.c ****
275:easyrider.c **** void check_light() {
276:easyrider.c **** // pin senses
277:easyrider.c **** if ((g_senses & FLAG_SENSE_LIGHT) == FLAG_SENSE_LIGHT) {
278:easyrider.c **** if (~STATUS_C90_SENSE_LIGHT) {
279:easyrider.c **** set_event(EV_LIGHT_ON);
280:easyrider.c **** }
281:easyrider.c **** if (STATUS_C90_SENSE_LIGHT) {
282:easyrider.c **** set_event(EV_LIGHT_OFF);
283:easyrider.c **** }
284:easyrider.c **** }
285:easyrider.c **** // dynamic senses
286:easyrider.c **** if ((g_dyn_senses & FLAG_SENSE_LIGHT) == FLAG_SENSE_LIGHT) {
287:easyrider.c **** if ((g_dyn_senses_status & FLAG_SENSE_LIGHT) == FLAG_SENSE_LIGHT) {
288:easyrider.c **** set_event(EV_LIGHT_OFF);
289:easyrider.c **** } else {
290:easyrider.c **** set_event(EV_LIGHT_ON);
291:easyrider.c **** }
292:easyrider.c **** }
293:easyrider.c **** }
294:easyrider.c ****
295:easyrider.c **** void check_brake() {
296:easyrider.c **** // pin senses
297:easyrider.c **** if ((g_senses & FLAG_SENSE_BRAKE) == FLAG_SENSE_BRAKE) {
298:easyrider.c **** if (~STATUS_C90_SENSE_BRAKE) {
299:easyrider.c **** set_event(EV_BRAKE_ON);
300:easyrider.c **** }
301:easyrider.c **** if (STATUS_C90_SENSE_BRAKE) {
302:easyrider.c **** set_event(EV_BRAKE_OFF);
303:easyrider.c **** }
304:easyrider.c **** }
305:easyrider.c **** // dynamic senses
306:easyrider.c **** if ((g_dyn_senses & FLAG_SENSE_BRAKE) == FLAG_SENSE_BRAKE) {
307:easyrider.c **** if ((g_dyn_senses_status & FLAG_SENSE_BRAKE) == FLAG_SENSE_BRAKE) {
308:easyrider.c **** set_event(EV_BRAKE_OFF);
309:easyrider.c **** } else {
310:easyrider.c **** set_event(EV_BRAKE_ON);
311:easyrider.c **** }
312:easyrider.c **** }
313:easyrider.c **** }
314:easyrider.c ****
315:easyrider.c **** void check_ign() {
316:easyrider.c **** // pin senses
317:easyrider.c **** if ((g_senses & FLAG_SENSE_IGN) == FLAG_SENSE_IGN) {
318:easyrider.c **** if (~STATUS_C90_SENSE_IGN) {
319:easyrider.c **** set_event(EV_IGN_ON);
320:easyrider.c **** }
321:easyrider.c **** if (STATUS_C90_SENSE_IGN) {
322:easyrider.c **** set_event(EV_IGN_OFF);
323:easyrider.c **** }
324:easyrider.c **** }
325:easyrider.c **** // dynamic senses
326:easyrider.c **** if ((g_dyn_senses & FLAG_SENSE_IGN) == FLAG_SENSE_IGN) {
327:easyrider.c **** if ((g_dyn_senses_status & FLAG_SENSE_IGN) == FLAG_SENSE_IGN) {
328:easyrider.c **** set_event(EV_IGN_OFF);
329:easyrider.c **** } else {
330:easyrider.c **** set_event(EV_IGN_ON);
331:easyrider.c **** }
332:easyrider.c **** }
333:easyrider.c **** }
334:easyrider.c ****
335:easyrider.c **** void check_alarm() {
336:easyrider.c **** // pin senses
337:easyrider.c **** if ((g_senses & FLAG_SENSE_ALARM) == FLAG_SENSE_ALARM) {
338:easyrider.c **** if (~STATUS_C90_SENSE_ALARM) {
339:easyrider.c **** set_event(EV_ALARM_ON);
340:easyrider.c **** }
341:easyrider.c **** if (STATUS_C90_SENSE_ALARM) {
342:easyrider.c **** set_event(EV_ALARM_OFF);
343:easyrider.c **** }
344:easyrider.c **** }
345:easyrider.c **** // dynamic senses
346:easyrider.c **** if ((g_dyn_senses & FLAG_SENSE_ALARM) == FLAG_SENSE_ALARM) {
347:easyrider.c **** if ((g_dyn_senses_status & FLAG_SENSE_ALARM) == FLAG_SENSE_ALARM) {
348:easyrider.c **** set_event(EV_ALARM_OFF);
349:easyrider.c **** } else {
350:easyrider.c **** set_event(EV_ALARM_ON);
351:easyrider.c **** }
352:easyrider.c **** }
353:easyrider.c **** }
354:easyrider.c ****
355:easyrider.c **** void check_battery() {
356:easyrider.c **** if (check_battery_read()) {
357:easyrider.c **** set_event(EV_READ_BATT);
358:easyrider.c **** }
359:easyrider.c **** }
360:easyrider.c ****
361:easyrider.c **** void check_sleep() {
362:easyrider.c **** if (g_state == ST_SLEEP) {
363:easyrider.c **** if (g_sleep_counter == 0) {
364:easyrider.c **** sleep_now();
365:easyrider.c **** }
366:easyrider.c **** } else {
367:easyrider.c **** g_sleep_counter = g_settings.deep_sleep_counter;
368:easyrider.c **** }