Kaynağa Gözat

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

Tanguy Pruvot 5 yıl önce
ebeveyn
işleme
977cfa4494

+ 5
- 1
Marlin/src/HAL/HAL_STM32F1/HAL.cpp Dosyayı Görüntüle

@@ -260,7 +260,11 @@ extern "C" {
260 260
 void HAL_adc_init(void) {
261 261
   // configure the ADC
262 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 268
   adc.setPins(adc_pins, ADC_PIN_COUNT);
265 269
   adc.setDMA(HAL_adc_results, (uint16_t)ADC_PIN_COUNT, (uint32_t)(DMA_MINC_MODE | DMA_CIRC_MODE), nullptr);
266 270
   adc.setScanMode();

+ 1
- 1
Marlin/src/HAL/HAL_STM32F1/HAL_spi_STM32F1.cpp Dosyayı Görüntüle

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

+ 0
- 1
Marlin/src/HAL/HAL_STM32F1/STM32F1_flag_script.py Dosyayı Görüntüle

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

+ 12
- 16
Marlin/src/lcd/dogm/HAL_LCD_com_defines.h Dosyayı Görüntüle

@@ -25,7 +25,6 @@
25 25
 
26 26
 #ifndef U8G_HAL_LINKS
27 27
 
28
-
29 28
   #ifdef __SAM3X8E__
30 29
     uint8_t u8g_com_HAL_DUE_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
31 30
     #define U8G_COM_HAL_SW_SPI_FN  u8g_com_HAL_DUE_sw_spi_fn
@@ -33,44 +32,41 @@
33 32
     #define U8G_COM_HAL_HW_SPI_FN u8g_com_HAL_DUE_shared_hw_spi_fn
34 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 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 36
   #elif defined(__STM32F1__)
37 37
     uint8_t u8g_com_HAL_STM32F1_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
38 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 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 40
     #define U8G_COM_ST7920_HAL_SW_SPI u8g_com_std_sw_spi_fn
45 41
     #define U8G_COM_ST7920_HAL_HW_SPI u8g_com_stm32duino_hw_spi_fn
46 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 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 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 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 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 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 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 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 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 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 64
     uint8_t u8g_com_stm32duino_fsmc_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
70 65
     #define U8G_COM_HAL_FSMC_FN u8g_com_stm32duino_fsmc_fn
71 66
   #else
72 67
     #define U8G_COM_HAL_FSMC_FN u8g_com_null_fn
73 68
   #endif
69
+
74 70
 #elif TARGET_LPC1768
75 71
   uint8_t u8g_com_HAL_LPC1768_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
76 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 Dosyayı Görüntüle

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

+ 5
- 10
config/examples/Alfawise/U20/Configuration.h Dosyayı Görüntüle

@@ -1619,8 +1619,11 @@
1619 1619
   // Middle point of circle
1620 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 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 1627
 #endif
1625 1628
 
1626 1629
 /**
@@ -2123,7 +2126,7 @@
2123 2126
 #define MKS_ROBIN_TFT
2124 2127
 
2125 2128
 //=============================================================================
2126
-//============================= SPI Touch Screens =============================
2129
+//============================  Other Controllers  ============================
2127 2130
 //=============================================================================
2128 2131
 
2129 2132
 #define TOUCH_BUTTONS
@@ -2147,14 +2150,6 @@
2147 2150
   #endif
2148 2151
 #endif
2149 2152
 
2150
-//=============================================================================
2151
-//============================  Other Controllers  ============================
2152
-//=============================================================================
2153
-
2154
-//
2155
-// CONTROLLER TYPE: Keypad / Add-on
2156
-//
2157
-
2158 2153
 //
2159 2154
 // RepRapWorld REPRAPWORLD_KEYPAD v1.1
2160 2155
 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626

Loading…
İptal
Kaydet