Revision 732a4657 kernel/patches/QEI-driver.patch

View differences:

kernel/patches/QEI-driver.patch
1 1
diff --git a/os/hal/hal.mk b/os/hal/hal.mk
2
index f177a3f..64d96d9 100644
3 2
--- a/os/hal/hal.mk
4 3
+++ b/os/hal/hal.mk
5
@@ -41,6 +41,9 @@ endif
6
 ifneq ($(findstring HAL_USE_ICU TRUE,$(HALCONF)),)
7
 HALSRC += $(CHIBIOS)/os/hal/src/hal_icu.c
4
@@ -54,6 +54,9 @@ endif
5
 ifneq ($(findstring HAL_USE_PWM TRUE,$(HALCONF)),)
6
 HALSRC += $(CHIBIOS)/os/hal/src/hal_pwm.c
8 7
 endif
9 8
+ifneq ($(findstring HAL_USE_QEI TRUE,$(HALCONF)),)
10 9
+HALSRC += $(CHIBIOS)/os/hal/src/hal_qei.c
11 10
+endif
12
 ifneq ($(findstring HAL_USE_MAC TRUE,$(HALCONF)),)
13
 HALSRC += $(CHIBIOS)/os/hal/src/hal_mac.c
11
 ifneq ($(findstring HAL_USE_RTC TRUE,$(HALCONF)),)
12
 HALSRC += $(CHIBIOS)/os/hal/src/hal_rtc.c
14 13
 endif
15
@@ -94,6 +97,7 @@ HALSRC = $(CHIBIOS)/os/hal/src/hal.c \
16
          $(CHIBIOS)/os/hal/src/hal_i2c.c \
17
          $(CHIBIOS)/os/hal/src/hal_i2s.c \
18
          $(CHIBIOS)/os/hal/src/hal_icu.c \
19
+         $(CHIBIOS)/os/hal/src/hal_qei.c \
20
          $(CHIBIOS)/os/hal/src/hal_mac.c \
14
@@ -104,6 +107,7 @@ HALSRC = $(CHIBIOS)/os/hal/src/hal.c \
21 15
          $(CHIBIOS)/os/hal/src/hal_mmc_spi.c \
22 16
          $(CHIBIOS)/os/hal/src/hal_pal.c \
17
          $(CHIBIOS)/os/hal/src/hal_pwm.c \
18
+         $(CHIBIOS)/os/hal/src/hal_qei.c \
19
          $(CHIBIOS)/os/hal/src/hal_rtc.c \
20
          $(CHIBIOS)/os/hal/src/hal_sdc.c \
21
          $(CHIBIOS)/os/hal/src/hal_serial.c \
23 22
diff --git a/os/hal/include/hal.h b/os/hal/include/hal.h
24
index 79f7c42..8cf221f 100644
25 23
--- a/os/hal/include/hal.h
26 24
+++ b/os/hal/include/hal.h
27
@@ -78,6 +78,10 @@
25
@@ -74,6 +74,10 @@
28 26
 #define HAL_USE_PWM                         FALSE
29 27
 #endif
30 28
 
......
32 30
+#define HAL_USE_QEI                         FALSE
33 31
+#endif
34 32
+
35
 #if !defined(HAL_USE_QSPI)
36
 #define HAL_USE_QSPI                        FALSE
33
 #if !defined(HAL_USE_RTC)
34
 #define HAL_USE_RTC                         FALSE
37 35
 #endif
38
@@ -138,6 +142,7 @@
36
@@ -142,6 +146,7 @@
39 37
 #include "hal_icu.h"
40 38
 #include "hal_mac.h"
41 39
 #include "hal_pwm.h"
42 40
+#include "hal_qei.h"
43
 #include "hal_qspi.h"
44 41
 #include "hal_rtc.h"
45 42
 #include "hal_serial.h"
43
 #include "hal_sdc.h"
46 44
diff --git a/os/hal/include/hal_qei.h b/os/hal/include/hal_qei.h
47 45
new file mode 100644
48
index 0000000..8769729
49 46
--- /dev/null
50 47
+++ b/os/hal/include/hal_qei.h
51 48
@@ -0,0 +1,148 @@
52 49
+/*
53 50
+AMiRo-OS is an operating system designed for the Autonomous Mini Robot (AMiRo) platform.
54
+Copyright (C) 2016..2018  Thomas Schöpping et al.
51
+Copyright (C) 2016..2019  Thomas Schöpping et al.
55 52
+
56 53
+This program is free software: you can redistribute it and/or modify
57 54
+it under the terms of the GNU General Public License as published by
......
192 189
+}
193 190
+#endif
194 191
+
195
+#endif /* HAL_USE_QEI */
192
+#endif /* HAL_USE_QEI == TRUE */
196 193
+
197 194
+#endif /* HAL_QEI_H */
198 195
+
199 196
+/** @} */
200 197
diff --git a/os/hal/ports/STM32/LLD/TIMv1/driver.mk b/os/hal/ports/STM32/LLD/TIMv1/driver.mk
201
index 032d75a..13e3571 100644
202 198
--- a/os/hal/ports/STM32/LLD/TIMv1/driver.mk
203 199
+++ b/os/hal/ports/STM32/LLD/TIMv1/driver.mk
204 200
@@ -10,10 +10,14 @@ endif
......
218 214
 PLATFORMINC += $(CHIBIOS)/os/hal/ports/STM32/LLD/TIMv1
219 215
diff --git a/os/hal/ports/STM32/LLD/TIMv1/hal_qei_lld.c b/os/hal/ports/STM32/LLD/TIMv1/hal_qei_lld.c
220 216
new file mode 100644
221
index 0000000..cd1ab9b
222 217
--- /dev/null
223 218
+++ b/os/hal/ports/STM32/LLD/TIMv1/hal_qei_lld.c
224 219
@@ -0,0 +1,304 @@
225 220
+/*
226 221
+AMiRo-OS is an operating system designed for the Autonomous Mini Robot (AMiRo) platform.
227
+Copyright (C) 2016..2018  Thomas Schöpping et al.
222
+Copyright (C) 2016..2019  Thomas Schöpping et al.
228 223
+
229 224
+This program is free software: you can redistribute it and/or modify
230 225
+it under the terms of the GNU General Public License as published by
......
528 523
+/** @} */
529 524
diff --git a/os/hal/ports/STM32/LLD/TIMv1/hal_qei_lld.h b/os/hal/ports/STM32/LLD/TIMv1/hal_qei_lld.h
530 525
new file mode 100644
531
index 0000000..ec1cd42
532 526
--- /dev/null
533 527
+++ b/os/hal/ports/STM32/LLD/TIMv1/hal_qei_lld.h
534 528
@@ -0,0 +1,302 @@
535 529
+/*
536 530
+AMiRo-OS is an operating system designed for the Autonomous Mini Robot (AMiRo) platform.
537
+Copyright (C) 2016..2018  Thomas Schöpping et al.
531
+Copyright (C) 2016..2019  Thomas Schöpping et al.
538 532
+
539 533
+This program is free software: you can redistribute it and/or modify
540 534
+it under the terms of the GNU General Public License as published by
......
836 830
+/** @} */
837 831
diff --git a/os/hal/src/hal_qei.c b/os/hal/src/hal_qei.c
838 832
new file mode 100644
839
index 0000000..00334bb
840 833
--- /dev/null
841 834
+++ b/os/hal/src/hal_qei.c
842 835
@@ -0,0 +1,152 @@
843 836
+/*
844 837
+AMiRo-OS is an operating system designed for the Autonomous Mini Robot (AMiRo) platform.
845
+Copyright (C) 2016..2018  Thomas Schöpping et al.
838
+Copyright (C) 2016..2019  Thomas Schöpping et al.
846 839
+
847 840
+This program is free software: you can redistribute it and/or modify
848 841
+it under the terms of the GNU General Public License as published by
......
989 982
+  osalSysUnlock();
990 983
+}
991 984
+
992
+#endif /* HAL_USE_QEI */
985
+#endif /* HAL_USE_QEI == TRUE */
993 986
+
994 987
+/** @} */

Also available in: Unified diff