Browse Source

Fix a few recent (STM32F1 DOGM, SPI) warnings (#14669)

Tanguy Pruvot 5 years ago
parent
commit
977cfa4494

+ 5
- 1
Marlin/src/HAL/HAL_STM32F1/HAL.cpp View File

260
 void HAL_adc_init(void) {
260
 void HAL_adc_init(void) {
261
   // configure the ADC
261
   // configure the ADC
262
   adc.calibrate();
262
   adc.calibrate();
263
-  adc.setSampleRate(ADC_SMPR_41_5); // ?
263
+  #if F_CPU > 72000000
264
+    adc.setSampleRate(ADC_SMPR_71_5); // 71.5 ADC cycles
265
+  #else
266
+    adc.setSampleRate(ADC_SMPR_41_5); // 41.5 ADC cycles
267
+  #endif
264
   adc.setPins(adc_pins, ADC_PIN_COUNT);
268
   adc.setPins(adc_pins, ADC_PIN_COUNT);
265
   adc.setDMA(HAL_adc_results, (uint16_t)ADC_PIN_COUNT, (uint32_t)(DMA_MINC_MODE | DMA_CIRC_MODE), nullptr);
269
   adc.setDMA(HAL_adc_results, (uint16_t)ADC_PIN_COUNT, (uint32_t)(DMA_MINC_MODE | DMA_CIRC_MODE), nullptr);
266
   adc.setScanMode();
270
   adc.setScanMode();

+ 1
- 1
Marlin/src/HAL/HAL_STM32F1/HAL_spi_STM32F1.cpp View File

104
  * @details
104
  * @details
105
  */
105
  */
106
 uint8_t spiRec(void) {
106
 uint8_t spiRec(void) {
107
-  uint8_t returnByte = SPI.transfer(0xFF);
107
+  uint8_t returnByte = SPI.transfer(ff);
108
   return returnByte;
108
   return returnByte;
109
 }
109
 }
110
 
110
 

+ 0
- 1
Marlin/src/HAL/HAL_STM32F1/STM32F1_flag_script.py View File

4
 #dynamic build flags for generic compile options
4
 #dynamic build flags for generic compile options
5
 if __name__ == "__main__":
5
 if __name__ == "__main__":
6
   args = " ".join([ "-std=gnu11",
6
   args = " ".join([ "-std=gnu11",
7
-                    "-std=gnu++11",
8
                     "-Os",
7
                     "-Os",
9
                     "-mcpu=cortex-m3",
8
                     "-mcpu=cortex-m3",
10
                     "-mthumb",
9
                     "-mthumb",

+ 12
- 16
Marlin/src/lcd/dogm/HAL_LCD_com_defines.h View File

25
 
25
 
26
 #ifndef U8G_HAL_LINKS
26
 #ifndef U8G_HAL_LINKS
27
 
27
 
28
-
29
   #ifdef __SAM3X8E__
28
   #ifdef __SAM3X8E__
30
     uint8_t u8g_com_HAL_DUE_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
29
     uint8_t u8g_com_HAL_DUE_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
31
     #define U8G_COM_HAL_SW_SPI_FN  u8g_com_HAL_DUE_sw_spi_fn
30
     #define U8G_COM_HAL_SW_SPI_FN  u8g_com_HAL_DUE_sw_spi_fn
33
     #define U8G_COM_HAL_HW_SPI_FN u8g_com_HAL_DUE_shared_hw_spi_fn
32
     #define U8G_COM_HAL_HW_SPI_FN u8g_com_HAL_DUE_shared_hw_spi_fn
34
     uint8_t u8g_com_HAL_DUE_ST7920_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
33
     uint8_t u8g_com_HAL_DUE_ST7920_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
35
     #define U8G_COM_ST7920_HAL_SW_SPI u8g_com_HAL_DUE_ST7920_sw_spi_fn
34
     #define U8G_COM_ST7920_HAL_SW_SPI u8g_com_HAL_DUE_ST7920_sw_spi_fn
35
+    #define U8G_COM_ST7920_HAL_HW_SPI u8g_com_arduino_st7920_hw_spi_fn
36
   #elif defined(__STM32F1__)
36
   #elif defined(__STM32F1__)
37
     uint8_t u8g_com_HAL_STM32F1_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
37
     uint8_t u8g_com_HAL_STM32F1_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_STM32F1_sw_spi_fn
38
     #define U8G_COM_HAL_SW_SPI_FN u8g_com_HAL_STM32F1_sw_spi_fn
39
-    uint8_t u8g_com_arduino_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_arduino_hw_spi_fn
41
     #define U8G_COM_HAL_HW_SPI_FN u8g_com_stm32duino_hw_spi_fn
39
     #define U8G_COM_HAL_HW_SPI_FN u8g_com_stm32duino_hw_spi_fn
42
-    uint8_t u8g_com_arduino_st7920_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
43
-    //#define U8G_COM_ST7920_HAL_SW_SPI u8g_com_arduino_st7920_spi_fn
44
     #define U8G_COM_ST7920_HAL_SW_SPI u8g_com_std_sw_spi_fn
40
     #define U8G_COM_ST7920_HAL_SW_SPI u8g_com_std_sw_spi_fn
45
     #define U8G_COM_ST7920_HAL_HW_SPI u8g_com_stm32duino_hw_spi_fn
41
     #define U8G_COM_ST7920_HAL_HW_SPI u8g_com_stm32duino_hw_spi_fn
46
   #elif defined(ARDUINO_ARCH_STM32)
42
   #elif defined(ARDUINO_ARCH_STM32)
47
-    uint8_t u8g_com_arduino_std_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
48
     #define U8G_COM_HAL_SW_SPI_FN u8g_com_arduino_std_sw_spi_fn
43
     #define U8G_COM_HAL_SW_SPI_FN u8g_com_arduino_std_sw_spi_fn
49
-    uint8_t u8g_com_stm32duino_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
50
     #define U8G_COM_HAL_HW_SPI_FN u8g_com_stm32duino_hw_spi_fn
44
     #define U8G_COM_HAL_HW_SPI_FN u8g_com_stm32duino_hw_spi_fn
51
-    uint8_t u8g_com_arduino_st7920_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
52
     #define U8G_COM_ST7920_HAL_SW_SPI u8g_com_arduino_st7920_spi_fn
45
     #define U8G_COM_ST7920_HAL_SW_SPI u8g_com_arduino_st7920_spi_fn
53
-  #else
46
+    #define U8G_COM_ST7920_HAL_HW_SPI u8g_com_stm32duino_hw_spi_fn
47
+  #elif defined(__AVR__)
54
     uint8_t u8g_com_HAL_AVR_sw_sp_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
48
     uint8_t u8g_com_HAL_AVR_sw_sp_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
55
-    #define U8G_COM_HAL_SW_SPI_FN  u8g_com_HAL_AVR_sw_sp_fn // AVR ?
56
-    uint8_t u8g_com_arduino_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
49
+    #define U8G_COM_HAL_SW_SPI_FN  u8g_com_HAL_AVR_sw_sp_fn
57
     #define U8G_COM_HAL_HW_SPI_FN u8g_com_arduino_hw_spi_fn
50
     #define U8G_COM_HAL_HW_SPI_FN u8g_com_arduino_hw_spi_fn
58
-    uint8_t u8g_com_arduino_st7920_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
59
     #define U8G_COM_ST7920_HAL_SW_SPI u8g_com_arduino_st7920_spi_fn
51
     #define U8G_COM_ST7920_HAL_SW_SPI u8g_com_arduino_st7920_spi_fn
52
+    #define U8G_COM_ST7920_HAL_HW_SPI u8g_com_arduino_st7920_hw_spi_fn
53
+  #else
54
+    #define U8G_COM_HAL_SW_SPI_FN u8g_com_arduino_std_sw_spi_fn
55
+    #define U8G_COM_HAL_HW_SPI_FN u8g_com_arduino_hw_spi_fn
56
+    #define U8G_COM_ST7920_HAL_SW_SPI u8g_com_arduino_st7920_spi_fn
57
+    #define U8G_COM_ST7920_HAL_HW_SPI u8g_com_arduino_st7920_hw_spi_fn
60
   #endif
58
   #endif
61
 
59
 
62
-  uint8_t u8g_com_arduino_st7920_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
63
-  #define U8G_COM_ST7920_HAL_HW_SPI u8g_com_arduino_st7920_hw_spi_fn
64
-
65
   uint8_t u8g_com_HAL_LPC1768_ssd_hw_i2c_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
60
   uint8_t u8g_com_HAL_LPC1768_ssd_hw_i2c_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
66
   #define U8G_COM_SSD_I2C_HAL u8g_com_arduino_ssd_i2c_fn
61
   #define U8G_COM_SSD_I2C_HAL u8g_com_arduino_ssd_i2c_fn
67
 
62
 
68
-  #if defined(ARDUINO_ARCH_STM32F1) && PIN_EXISTS(FSMC_CS)
63
+  #if PIN_EXISTS(FSMC_CS)
69
     uint8_t u8g_com_stm32duino_fsmc_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
64
     uint8_t u8g_com_stm32duino_fsmc_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
70
     #define U8G_COM_HAL_FSMC_FN u8g_com_stm32duino_fsmc_fn
65
     #define U8G_COM_HAL_FSMC_FN u8g_com_stm32duino_fsmc_fn
71
   #else
66
   #else
72
     #define U8G_COM_HAL_FSMC_FN u8g_com_null_fn
67
     #define U8G_COM_HAL_FSMC_FN u8g_com_null_fn
73
   #endif
68
   #endif
69
+
74
 #elif TARGET_LPC1768
70
 #elif TARGET_LPC1768
75
   uint8_t u8g_com_HAL_LPC1768_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
71
   uint8_t u8g_com_HAL_LPC1768_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
76
   #define U8G_COM_HAL_SW_SPI_FN u8g_com_HAL_LPC1768_sw_spi_fn
72
   #define U8G_COM_HAL_SW_SPI_FN u8g_com_HAL_LPC1768_sw_spi_fn

+ 0
- 1
Marlin/src/lcd/dogm/u8g_dev_tft_320x240_upscale_from_128x64.cpp View File

334
   #else
334
   #else
335
     uint16_t buffer[256]; // 16-bit RGB 565 pixel line buffer
335
     uint16_t buffer[256]; // 16-bit RGB 565 pixel line buffer
336
   #endif
336
   #endif
337
-  uint16_t i;
338
   switch (msg) {
337
   switch (msg) {
339
     case U8G_DEV_MSG_INIT:
338
     case U8G_DEV_MSG_INIT:
340
       dev->com_fn(u8g, U8G_COM_MSG_INIT, U8G_SPI_CLK_CYCLE_NONE, &lcd_id);
339
       dev->com_fn(u8g, U8G_COM_MSG_INIT, U8G_SPI_CLK_CYCLE_NONE, &lcd_id);

+ 5
- 10
config/examples/Alfawise/U20/Configuration.h View File

1619
   // Middle point of circle
1619
   // Middle point of circle
1620
   #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT
1620
   #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT
1621
 
1621
 
1622
-  // Moves the nozzle to the initial position
1622
+  // Move the nozzle to the initial position after cleaning
1623
   #define NOZZLE_CLEAN_GOBACK
1623
   #define NOZZLE_CLEAN_GOBACK
1624
+
1625
+  // Enable for a purge/clean station that's always at the gantry height (thus no Z move)
1626
+  //#define NOZZLE_CLEAN_NO_Z
1624
 #endif
1627
 #endif
1625
 
1628
 
1626
 /**
1629
 /**
2123
 #define MKS_ROBIN_TFT
2126
 #define MKS_ROBIN_TFT
2124
 
2127
 
2125
 //=============================================================================
2128
 //=============================================================================
2126
-//============================= SPI Touch Screens =============================
2129
+//============================  Other Controllers  ============================
2127
 //=============================================================================
2130
 //=============================================================================
2128
 
2131
 
2129
 #define TOUCH_BUTTONS
2132
 #define TOUCH_BUTTONS
2147
   #endif
2150
   #endif
2148
 #endif
2151
 #endif
2149
 
2152
 
2150
-//=============================================================================
2151
-//============================  Other Controllers  ============================
2152
-//=============================================================================
2153
-
2154
-//
2155
-// CONTROLLER TYPE: Keypad / Add-on
2156
-//
2157
-
2158
 //
2153
 //
2159
 // RepRapWorld REPRAPWORLD_KEYPAD v1.1
2154
 // RepRapWorld REPRAPWORLD_KEYPAD v1.1
2160
 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626
2155
 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626

Loading…
Cancel
Save