mirror of
https://github.com/tbnobody/OpenDTU.git
synced 2025-12-11 01:10:20 +01:00
Move SpiManager registration into PinMapping class
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
#include "Utils.h"
|
||||
#include <ArduinoJson.h>
|
||||
#include <LittleFS.h>
|
||||
#include <SpiManager.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifndef DISPLAY_TYPE
|
||||
@@ -194,6 +195,13 @@ PinMapping_t& PinMappingClass::get()
|
||||
|
||||
bool PinMappingClass::init(const String& deviceMapping)
|
||||
{
|
||||
|
||||
// Initialize SpiManager
|
||||
SpiManagerInst.register_bus(SPI2_HOST);
|
||||
#if SOC_SPI_PERIPH_NUM > 2
|
||||
SpiManagerInst.register_bus(SPI3_HOST);
|
||||
#endif
|
||||
|
||||
File f = LittleFS.open(PINMAPPING_FILENAME, "r", false);
|
||||
|
||||
if (!f) {
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
#include "defaults.h"
|
||||
#include <Arduino.h>
|
||||
#include <LittleFS.h>
|
||||
#include <SpiManager.h>
|
||||
#include <TaskScheduler.h>
|
||||
#include <esp_heap_caps.h>
|
||||
|
||||
@@ -34,12 +33,6 @@ void setup()
|
||||
// Move all dynamic allocations >512byte to psram (if available)
|
||||
heap_caps_malloc_extmem_enable(512);
|
||||
|
||||
// Initialize SpiManager
|
||||
SpiManagerInst.register_bus(SPI2_HOST);
|
||||
#if SOC_SPI_PERIPH_NUM > 2
|
||||
SpiManagerInst.register_bus(SPI3_HOST);
|
||||
#endif
|
||||
|
||||
// Initialize serial output
|
||||
Serial.begin(SERIAL_BAUDRATE);
|
||||
#if !ARDUINO_USB_CDC_ON_BOOT
|
||||
|
||||
Reference in New Issue
Block a user