Преглед изворни кода

refactor(gpio):add gpio linker.lf to control the placement of driver and hal

since the linker placement of the hal functions are controlled by the Kconfig in the driver component,
we should create the linker.lf in the driver component, not in the hal component.
Chen Jichang пре 2 година
родитељ
комит
cdd18fd232

+ 1 - 1
components/driver/CMakeLists.txt

@@ -216,7 +216,7 @@ else()
                         INCLUDE_DIRS ${includes}
                         PRIV_REQUIRES efuse esp_timer
                         REQUIRES esp_pm esp_ringbuf freertos soc hal esp_hw_support
-                        LDFRAGMENTS linker.lf gptimer/linker.lf)
+                        LDFRAGMENTS linker.lf gptimer/linker.lf gpio/linker.lf)
 endif()
 
 # If system needs to monitor USJ connection status, then usb_serial_jtag_connection_monitor object file has to be linked

+ 12 - 0
components/driver/gpio/linker.lf

@@ -0,0 +1,12 @@
+[mapping:gpio_driver]
+archive: libdriver.a
+entries:
+    if GPIO_CTRL_FUNC_IN_IRAM = y:
+        gpio: gpio_set_level (noflash)
+        gpio: gpio_intr_disable (noflash)
+
+[mapping:gpio_hal]
+archive: libhal.a
+entries:
+    if GPIO_CTRL_FUNC_IN_IRAM = y:
+        gpio_hal: gpio_hal_intr_disable (noflash)

+ 0 - 10
components/driver/linker.lf

@@ -1,21 +1,11 @@
 [mapping:driver]
 archive: libdriver.a
 entries:
-    if GPTIMER_CTRL_FUNC_IN_IRAM = y:
-        gptimer: gptimer_set_raw_count (noflash)
-        gptimer: gptimer_get_raw_count (noflash)
-        gptimer: gptimer_get_captured_count (noflash)
-        gptimer: gptimer_set_alarm_action (noflash)
-        gptimer: gptimer_start (noflash)
-        gptimer: gptimer_stop (noflash)
     if PCNT_CTRL_FUNC_IN_IRAM = y:
         pulse_cnt: pcnt_unit_start (noflash)
         pulse_cnt: pcnt_unit_stop (noflash)
         pulse_cnt: pcnt_unit_clear_count (noflash)
         pulse_cnt: pcnt_unit_get_count (noflash)
-    if GPIO_CTRL_FUNC_IN_IRAM = y:
-        gpio: gpio_set_level (noflash)
-        gpio: gpio_intr_disable (noflash)
     if SDM_CTRL_FUNC_IN_IRAM = y:
         sdm: sdm_channel_set_pulse_density (noflash)
     if ANA_CMPR_CTRL_FUNC_IN_IRAM = y:

+ 0 - 2
components/hal/linker.lf

@@ -30,8 +30,6 @@ entries:
         twai_hal_iram (noflash)
     if IDF_TARGET_ESP32 = n:
         spi_flash_hal_gpspi (noflash)
-    if GPIO_CTRL_FUNC_IN_IRAM = y:
-        gpio_hal: gpio_hal_intr_disable (noflash)
     if ADC_ONESHOT_CTRL_FUNC_IN_IRAM = y:
         adc_oneshot_hal (noflash)
         if COMPILER_OPTIMIZATION_DEBUG = y: