Explorar el Código

Clean up u8g defines

Scott Lahteine hace 4 años
padre
commit
72876d9045
Se han modificado 1 ficheros con 59 adiciones y 55 borrados
  1. 59
    55
      Marlin/src/lcd/dogm/HAL_LCD_com_defines.h

+ 59
- 55
Marlin/src/lcd/dogm/HAL_LCD_com_defines.h Ver fichero

@@ -27,91 +27,95 @@
27 27
 
28 28
 #ifndef U8G_HAL_LINKS
29 29
 
30
-  // generic prototypes
31
-  uint8_t u8g_com_arduino_std_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
32
-  uint8_t u8g_com_arduino_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
33
-  uint8_t u8g_com_arduino_st7920_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
34
-  uint8_t u8g_com_arduino_st7920_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
35
-
36 30
   #ifdef __SAM3X8E__
31
+
37 32
     uint8_t u8g_com_HAL_DUE_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
38
-    #define U8G_COM_HAL_SW_SPI_FN       u8g_com_HAL_DUE_sw_spi_fn
39 33
     uint8_t u8g_com_HAL_DUE_shared_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
40
-    #define U8G_COM_HAL_HW_SPI_FN       u8g_com_HAL_DUE_shared_hw_spi_fn
41 34
     uint8_t u8g_com_HAL_DUE_ST7920_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
42
-    #define U8G_COM_ST7920_HAL_SW_SPI   u8g_com_HAL_DUE_ST7920_sw_spi_fn
43
-    #define U8G_COM_ST7920_HAL_HW_SPI   u8g_com_arduino_st7920_hw_spi_fn
35
+    #define U8G_COM_HAL_SW_SPI_FN     u8g_com_HAL_DUE_sw_spi_fn
36
+    #define U8G_COM_HAL_HW_SPI_FN     u8g_com_HAL_DUE_shared_hw_spi_fn
37
+    #define U8G_COM_ST7920_HAL_SW_SPI u8g_com_HAL_DUE_ST7920_sw_spi_fn
38
+
39
+  #elif defined(__SAMD51__)
40
+
41
+    #define U8G_COM_HAL_HW_SPI_FN     u8g_com_samd51_hw_spi_fn
42
+    #define U8G_COM_ST7920_HAL_HW_SPI u8g_com_samd51_st7920_hw_spi_fn
43
+
44 44
   #elif defined(__STM32F1__)
45
+
45 46
     uint8_t u8g_com_HAL_STM32F1_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
46
-    #define U8G_COM_HAL_SW_SPI_FN       u8g_com_HAL_STM32F1_sw_spi_fn
47 47
     uint8_t u8g_com_stm32duino_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
48
-    #define U8G_COM_HAL_HW_SPI_FN       u8g_com_stm32duino_hw_spi_fn
49
-    #define U8G_COM_ST7920_HAL_SW_SPI   u8g_com_std_sw_spi_fn
50
-    #define U8G_COM_ST7920_HAL_HW_SPI   u8g_com_stm32duino_hw_spi_fn
48
+    #define U8G_COM_HAL_SW_SPI_FN     u8g_com_HAL_STM32F1_sw_spi_fn
49
+    #define U8G_COM_HAL_HW_SPI_FN     u8g_com_stm32duino_hw_spi_fn
50
+    #define U8G_COM_ST7920_HAL_SW_SPI u8g_com_std_sw_spi_fn
51
+    #define U8G_COM_ST7920_HAL_HW_SPI u8g_com_stm32duino_hw_spi_fn
52
+
51 53
   #elif defined(ARDUINO_ARCH_STM32)
52
-    #define U8G_COM_HAL_SW_SPI_FN       u8g_com_arduino_std_sw_spi_fn
54
+
53 55
     uint8_t u8g_com_stm32duino_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
54
-    #define U8G_COM_HAL_HW_SPI_FN       u8g_com_stm32duino_hw_spi_fn
55
-    #define U8G_COM_ST7920_HAL_SW_SPI   u8g_com_arduino_st7920_spi_fn
56
-    #define U8G_COM_ST7920_HAL_HW_SPI   u8g_com_arduino_st7920_hw_spi_fn
56
+    #define U8G_COM_HAL_HW_SPI_FN     u8g_com_stm32duino_hw_spi_fn
57
+
57 58
   #elif defined(__AVR__)
59
+
58 60
     uint8_t u8g_com_HAL_AVR_sw_sp_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
59
-    #define U8G_COM_HAL_SW_SPI_FN       u8g_com_HAL_AVR_sw_sp_fn
60
-    #define U8G_COM_HAL_HW_SPI_FN       u8g_com_arduino_hw_spi_fn
61
-    #define U8G_COM_ST7920_HAL_SW_SPI   u8g_com_arduino_st7920_spi_fn
62
-    #define U8G_COM_ST7920_HAL_HW_SPI   u8g_com_arduino_st7920_hw_spi_fn
63
-  #elif defined(__SAMD51__)
64
-    #define U8G_COM_HAL_SW_SPI_FN       u8g_com_arduino_std_sw_spi_fn
65
-    #define U8G_COM_HAL_HW_SPI_FN       u8g_com_samd51_hw_spi_fn
66
-    #define U8G_COM_ST7920_HAL_SW_SPI   u8g_com_arduino_st7920_spi_fn
67
-    #define U8G_COM_ST7920_HAL_HW_SPI   u8g_com_samd51_st7920_hw_spi_fn
68
-  #else
69
-    #define U8G_COM_HAL_SW_SPI_FN       u8g_com_arduino_std_sw_spi_fn
70
-    #define U8G_COM_HAL_HW_SPI_FN       u8g_com_arduino_hw_spi_fn
71
-    #define U8G_COM_ST7920_HAL_SW_SPI   u8g_com_arduino_st7920_spi_fn
72
-    #define U8G_COM_ST7920_HAL_HW_SPI   u8g_com_arduino_st7920_hw_spi_fn
61
+    #define U8G_COM_HAL_SW_SPI_FN     u8g_com_HAL_AVR_sw_sp_fn
62
+
63
+  #endif
64
+
65
+  #ifndef U8G_COM_HAL_SW_SPI_FN
66
+    #define U8G_COM_HAL_SW_SPI_FN     u8g_com_arduino_std_sw_spi_fn
67
+  #endif
68
+  #ifndef U8G_COM_HAL_HW_SPI_FN
69
+    #define U8G_COM_HAL_HW_SPI_FN     u8g_com_arduino_hw_spi_fn
70
+  #endif
71
+  #ifndef U8G_COM_ST7920_HAL_SW_SPI
72
+    #define U8G_COM_ST7920_HAL_SW_SPI u8g_com_arduino_st7920_spi_fn
73
+  #endif
74
+  #ifndef U8G_COM_ST7920_HAL_HW_SPI
75
+    #define U8G_COM_ST7920_HAL_HW_SPI u8g_com_arduino_st7920_hw_spi_fn
73 76
   #endif
74 77
 
75 78
   #ifdef TARGET_LPC1768
76 79
     uint8_t u8g_com_HAL_LPC1768_ssd_hw_i2c_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
77 80
   #endif
78 81
 
79
-  #define U8G_COM_SSD_I2C_HAL     u8g_com_arduino_ssd_i2c_fn
82
+  #define U8G_COM_SSD_I2C_HAL         u8g_com_arduino_ssd_i2c_fn
80 83
 
81 84
   #if PIN_EXISTS(FSMC_CS)
82 85
     uint8_t u8g_com_stm32duino_fsmc_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
83
-    #define U8G_COM_HAL_FSMC_FN   u8g_com_stm32duino_fsmc_fn
84
-  #else
85
-    #define U8G_COM_HAL_FSMC_FN   u8g_com_null_fn
86
+    #define U8G_COM_HAL_FSMC_FN       u8g_com_stm32duino_fsmc_fn
86 87
   #endif
87 88
 
88 89
 #elif defined(TARGET_LPC1768)
89 90
 
90 91
   uint8_t u8g_com_HAL_LPC1768_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
91
-  #define U8G_COM_HAL_SW_SPI_FN       u8g_com_HAL_LPC1768_sw_spi_fn
92
-
93 92
   uint8_t u8g_com_HAL_LPC1768_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
94
-  #define U8G_COM_HAL_HW_SPI_FN       u8g_com_HAL_LPC1768_hw_spi_fn
95
-
96 93
   uint8_t u8g_com_HAL_LPC1768_ST7920_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
97
-  #define U8G_COM_ST7920_HAL_SW_SPI   u8g_com_HAL_LPC1768_ST7920_sw_spi_fn
98
-
99 94
   uint8_t u8g_com_HAL_LPC1768_ST7920_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
100
-  #define U8G_COM_ST7920_HAL_HW_SPI   u8g_com_HAL_LPC1768_ST7920_hw_spi_fn
101
-
102 95
   uint8_t u8g_com_HAL_LPC1768_ssd_hw_i2c_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
96
+  #define U8G_COM_HAL_SW_SPI_FN       u8g_com_HAL_LPC1768_sw_spi_fn
97
+  #define U8G_COM_HAL_HW_SPI_FN       u8g_com_HAL_LPC1768_hw_spi_fn
98
+  #define U8G_COM_ST7920_HAL_SW_SPI   u8g_com_HAL_LPC1768_ST7920_sw_spi_fn
99
+  #define U8G_COM_ST7920_HAL_HW_SPI   u8g_com_HAL_LPC1768_ST7920_hw_spi_fn
103 100
   #define U8G_COM_SSD_I2C_HAL         u8g_com_HAL_LPC1768_ssd_hw_i2c_fn
104 101
 
105
-  #define U8G_COM_HAL_FSMC_FN         u8g_com_null_fn
106
-
107
-#else  // need to give them some definition or else get compiler errors
108
-
109
-  uint8_t u8g_com_null_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
110
-  #define U8G_COM_HAL_SW_SPI_FN       u8g_com_null_fn
111
-  #define U8G_COM_HAL_HW_SPI_FN       u8g_com_null_fn
112
-  #define U8G_COM_ST7920_HAL_SW_SPI   u8g_com_null_fn
113
-  #define U8G_COM_ST7920_HAL_HW_SPI   u8g_com_null_fn
114
-  #define U8G_COM_SSD_I2C_HAL         u8g_com_null_fn
115
-  #define U8G_COM_HAL_FSMC_FN         u8g_com_null_fn
102
+#endif
116 103
 
104
+#ifndef U8G_COM_HAL_SW_SPI_FN
105
+  #define U8G_COM_HAL_SW_SPI_FN     u8g_com_null_fn
106
+#endif
107
+#ifndef U8G_COM_HAL_HW_SPI_FN
108
+  #define U8G_COM_HAL_HW_SPI_FN     u8g_com_null_fn
109
+#endif
110
+#ifndef U8G_COM_ST7920_HAL_SW_SPI
111
+  #define U8G_COM_ST7920_HAL_SW_SPI u8g_com_null_fn
112
+#endif
113
+#ifndef U8G_COM_ST7920_HAL_HW_SPI
114
+  #define U8G_COM_ST7920_HAL_HW_SPI u8g_com_null_fn
115
+#endif
116
+#ifndef U8G_COM_SSD_I2C_HAL
117
+  #define U8G_COM_SSD_I2C_HAL       u8g_com_null_fn
118
+#endif
119
+#ifndef U8G_COM_HAL_FSMC_FN
120
+  #define U8G_COM_HAL_FSMC_FN       u8g_com_null_fn
117 121
 #endif

Loading…
Cancelar
Guardar