Skip to content

Commit

Permalink
fix(ulp_riscv): Fixed the header inclusion dependency for ulp_riscv_r…
Browse files Browse the repository at this point in the history
…egister_ops.h

There are redefinition compilation warnings for the register operation
macros when a ULP program was compiled which included soc.h before
ulp_riscv_register_ops.h. This commit fixes the issues by delegating the
exclusion macro to the CMakeLists.txt file.

Closes: espressif#12116
  • Loading branch information
sudeep-mohanty authored and CommanderRedYT committed Sep 24, 2023
1 parent b1e9016 commit eae0ea7
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions components/ulp/cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ if(ULP_COCPU_IS_RISCV)
target_link_options(${ULP_APP_NAME} PRIVATE SHELL:-T ${IDF_PATH}/components/ulp/ld/${IDF_TARGET}.peripherals.ld)
target_link_options(${ULP_APP_NAME} PRIVATE "-Wl,--no-warn-rwx-segments")
target_compile_definitions(${ULP_APP_NAME} PRIVATE IS_ULP_COCPU)
target_compile_definitions(${ULP_APP_NAME} PRIVATE ULP_RISCV_REGISTER_OPS)

elseif(ULP_COCPU_IS_LP_CORE)
list(APPEND ULP_S_SOURCES
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#pragma once

#include "ulp_riscv_register_ops.h"
#include "hal/adc_ll.h"

#ifdef __cplusplus
Expand Down
2 changes: 1 addition & 1 deletion components/ulp/ulp_riscv/ulp_core/include/ulp_riscv_gpio.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ extern "C" {

#include "soc/rtc_io_reg.h"
#include "soc/sens_reg.h"

#include "ulp_riscv_register_ops.h"

typedef enum {
GPIO_NUM_0 = 0, /*!< GPIO0, input and output */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@
*/

#pragma once
#define ULP_RISCV_REGISTER_OPS

#ifdef __cplusplus
extern "C" {
#endif


//Registers Operation {{

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#pragma once

#include "esp_err.h"
#include "ulp_riscv_register_ops.h"
#include "hal/touch_sensor_types.h"

#ifdef __cplusplus
Expand Down

0 comments on commit eae0ea7

Please sign in to comment.