Skip to content

fix: pin_remap: make periman APIs private and non-remapped #8940

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion cores/esp32/esp32-hal.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ void yield(void);
#include "esp32-hal-psram.h"
#include "esp32-hal-rgb-led.h"
#include "esp32-hal-cpu.h"
#include "esp32-hal-periman.h"

void analogWrite(uint8_t pin, int value);
void analogWriteFrequency(uint8_t pin, uint32_t freq);
Expand Down
10 changes: 0 additions & 10 deletions cores/esp32/io_pin_remap.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,6 @@ int8_t gpioNumberToDigitalPin(int8_t gpioNumber);
#define pinMatrixOutAttach(pin, function, invertOut, invertEnable) pinMatrixOutAttach(digitalPinToGPIONumber(pin), function, invertOut, invertEnable)
#define pinMatrixOutDetach(pin, invertOut, invertEnable) pinMatrixOutDetach(digitalPinToGPIONumber(pin), invertOut, invertEnable)

// cores/esp32/esp32-hal-periman.h
#define perimanSetPinBus(pin, type, bus, bus_num, bus_channel) perimanSetPinBus(digitalPinToGPIONumber(pin), type, bus, bus_num, bus_channel)
#define perimanGetPinBus(pin, type) perimanGetPinBus(digitalPinToGPIONumber(pin), type)
#define perimanGetPinBusType(pin) perimanGetPinBusType(digitalPinToGPIONumber(pin))
#define perimanGetPinBusNum(pin) perimanGetPinBusNum(digitalPinToGPIONumber(pin))
#define perimanGetPinBusChannel(pin) perimanGetPinBusChannel(digitalPinToGPIONumber(pin))
#define perimanPinIsValid(pin) perimanPinIsValid(digitalPinToGPIONumber(pin))
#define perimanSetPinBusExtraType(pin, extra_type) perimanSetPinBusExtraType(digitalPinToGPIONumber(pin), extra_type)
#define perimanGetPinBusExtraType(pin) perimanGetPinBusExtraType(digitalPinToGPIONumber(pin))

// cores/esp32/esp32-hal-rgb-led.h
#define neopixelWrite(pin, red_val, green_val, blue_val) neopixelWrite(digitalPinToGPIONumber(pin), red_val, green_val, blue_val)

Expand Down
6 changes: 5 additions & 1 deletion libraries/SD/src/sd_diskio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Disable the automatic pin remapping of the API calls in this file
#define ARDUINO_CORE_BUILD

#include "sd_diskio.h"
#include "esp_system.h"
#include "esp32-hal-periman.h"
Expand Down Expand Up @@ -742,7 +746,7 @@ uint8_t sdcard_init(uint8_t cs, SPIClass * spi, int hz)
card->base_path = NULL;
card->frequency = hz;
card->spi = spi;
card->ssPin = cs;
card->ssPin = digitalPinToGPIONumber(cs);

card->supports_crc = true;
card->type = CARD_NONE;
Expand Down