소스 검색

Cleanup old pio envs, fix some compilation issues with compile flags

Removed some legacy platformio envs that are not actively being maintained. But also fixed some bugs with different build flags that caused compilation issues.

Fixes #49
Scott Bezek 3 년 전
부모
커밋
45fd9f4e3e
3개의 변경된 파일10개의 추가작업 그리고 68개의 파일을 삭제
  1. 5 67
      firmware/platformio.ini
  2. 2 0
      firmware/src/display_task.cpp
  3. 3 1
      firmware/src/mt6701_sensor.cpp

+ 5 - 67
firmware/platformio.ini

@@ -8,6 +8,9 @@
 ; Please visit documentation for the other options and examples
 ; Please visit documentation for the other options and examples
 ; https://docs.platformio.org/page/projectconf.html
 ; https://docs.platformio.org/page/projectconf.html
 
 
+[platformio]
+default_envs = view
+
 [base_config]
 [base_config]
 platform = espressif32@3.4
 platform = espressif32@3.4
 framework = arduino
 framework = arduino
@@ -24,50 +27,6 @@ lib_deps =
 build_flags =
 build_flags =
   -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_DEBUG
   -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_DEBUG
 
 
-[env:proto]
-extends = base_config
-board = esp32doit-devkit-v1
-lib_deps =
-  ${base_config.lib_deps}
-  bodmer/TFT_eSPI@2.4.25
-
-build_flags =
-  ${base_config.build_flags}
-  -DSK_DISPLAY=1
-
-  -DPIN_UH=27
-  -DPIN_UL=26
-  -DPIN_VH=25
-  -DPIN_VL=33
-  -DPIN_WH=32
-  -DPIN_WL=13
-  -DPIN_BUTTON_NEXT=36
-  -DPIN_BUTTON_PREV=-1
-  -DPIN_SDA=-1
-  -DPIN_SCL=-1
-  -DSENSOR_MT6701=1
-
-  -DDESCRIPTION_FONT=Roboto_Thin_24
-  -DDESCRIPTION_Y_OFFSET=20
-  -DVALUE_OFFSET=30
-  -DDRAW_ARC=0
-
-  -DUSER_SETUP_LOADED=1
-  -DGC9A01_DRIVER=1
-  -DCGRAM_OFFSET=1
-  -DTFT_WIDTH=240
-  -DTFT_HEIGHT=240
-  -DTFT_MISO=-1
-  -DTFT_MOSI=19
-  -DTFT_SCLK=18
-  -DTFT_CS=5
-  -DTFT_DC=16
-  -DTFT_RST=23
-  -DTFT_BL=4
-  -DLOAD_GLCD=1
-  -DLOAD_GFXFF=1
-  -DSPI_FREQUENCY=40000000
-
 [env:view]
 [env:view]
 extends = base_config
 extends = base_config
 ; platform = https://github.com/platformio/platform-espressif32.git#feature/arduino-upstream
 ; platform = https://github.com/platformio/platform-espressif32.git#feature/arduino-upstream
@@ -109,8 +68,6 @@ build_flags =
   -DPIN_LED_DATA=7
   -DPIN_LED_DATA=7
   -DPIN_LCD_BACKLIGHT=19
   -DPIN_LCD_BACKLIGHT=19
 
 
-  -DLEDC_CHANNEL_LCD_BACKLIGHT=0
-
   -DDESCRIPTION_FONT=Roboto_Thin_24
   -DDESCRIPTION_FONT=Roboto_Thin_24
   -DDESCRIPTION_Y_OFFSET=20
   -DDESCRIPTION_Y_OFFSET=20
   -DVALUE_OFFSET=30
   -DVALUE_OFFSET=30
@@ -147,26 +104,6 @@ build_flags =
   ; (SOC_GPIO_VALID_GPIO_MASK & ~(0ULL | _FL_BIT(34) | _FL_BIT(35) | _FL_BIT(36) | _FL_BIT(37) | _FL_BIT(38) | _FL_BIT(39)))
   ; (SOC_GPIO_VALID_GPIO_MASK & ~(0ULL | _FL_BIT(34) | _FL_BIT(35) | _FL_BIT(36) | _FL_BIT(37) | _FL_BIT(38) | _FL_BIT(39)))
   -DSOC_GPIO_VALID_OUTPUT_GPIO_MASK=0x30EFFFFFF
   -DSOC_GPIO_VALID_OUTPUT_GPIO_MASK=0x30EFFFFFF
 
 
-
-[env:handheld]
-extends = base_config
-board = tinypico
-
-build_flags =
-  ${base_config.build_flags}
-  -DSK_DISPLAY=0
-
-  -DPIN_UH=25
-  -DPIN_UL=26
-  -DPIN_VH=27
-  -DPIN_VL=15
-  -DPIN_WH=14
-  -DPIN_WL=4
-  -DPIN_BUTTON_NEXT=23
-  -DPIN_BUTTON_PREV=-1
-  -DPIN_SDA=33
-  -DPIN_SCL=32
-  -DSENSOR_TLV=1
   
   
 [env:handheld_tdisplay]
 [env:handheld_tdisplay]
 extends = base_config
 extends = base_config
@@ -195,6 +132,7 @@ build_flags =
   -DPIN_MT_DATA=21
   -DPIN_MT_DATA=21
   -DPIN_MT_CLOCK=22
   -DPIN_MT_CLOCK=22
   -DPIN_MT_CSN=12
   -DPIN_MT_CSN=12
+  -DPIN_LCD_BACKLIGHT=4
 
 
   -DDESCRIPTION_FONT=FreeSans9pt7b
   -DDESCRIPTION_FONT=FreeSans9pt7b
   -DDESCRIPTION_Y_OFFSET=80
   -DDESCRIPTION_Y_OFFSET=80
@@ -212,7 +150,7 @@ build_flags =
   -DTFT_CS=5
   -DTFT_CS=5
   -DTFT_DC=16
   -DTFT_DC=16
   -DTFT_RST=23
   -DTFT_RST=23
-  -DTFT_BL=4
+  -DTFT_BL=-1
   -DLOAD_GLCD=1
   -DLOAD_GLCD=1
   -DLOAD_GFXFF=1
   -DLOAD_GFXFF=1
   -DSPI_FREQUENCY=40000000
   -DSPI_FREQUENCY=40000000

+ 2 - 0
firmware/src/display_task.cpp

@@ -4,6 +4,8 @@
 
 
 #include "font/roboto_light_60.h"
 #include "font/roboto_light_60.h"
 
 
+static const uint8_t LEDC_CHANNEL_LCD_BACKLIGHT = 0;
+
 DisplayTask::DisplayTask(const uint8_t task_core) : Task{"Display", 4048, 1, task_core} {
 DisplayTask::DisplayTask(const uint8_t task_core) : Task{"Display", 4048, 1, task_core} {
   knob_state_queue_ = xQueueCreate(1, sizeof(KnobState));
   knob_state_queue_ = xQueueCreate(1, sizeof(KnobState));
   assert(knob_state_queue_ != NULL);
   assert(knob_state_queue_ != NULL);

+ 3 - 1
firmware/src/mt6701_sensor.cpp

@@ -34,7 +34,7 @@ static uint8_t CRC6_43_18bit (uint32_t w_InputData)
  return b_CRC;
  return b_CRC;
 } 
 } 
 
 
-
+#if SENSOR_MT6701
 
 
 MT6701Sensor::MT6701Sensor() {}
 MT6701Sensor::MT6701Sensor() {}
 
 
@@ -116,3 +116,5 @@ float MT6701Sensor::getSensorAngle() {
     }
     }
     return rad;
     return rad;
 }
 }
+
+#endif