1
0
Fork 0

switch to another arduino core?

sd2
radex 2024-06-01 12:47:54 +02:00
parent 92edaca309
commit c2a5081fbc
Signed by: radex
SSH Key Fingerprint: SHA256:hvqRXAGG1h89yqnS+cyFTLKQbzjWD4uXIqw7Y+0ws30
4 changed files with 12 additions and 5 deletions

View File

@ -9,9 +9,11 @@
; https://docs.platformio.org/page/projectconf.html ; https://docs.platformio.org/page/projectconf.html
[env:pico] [env:pico]
platform = raspberrypi platform = https://github.com/maxgerhardt/platform-raspberrypi.git
board = pico board = pico
framework = arduino framework = arduino
board_build.core = earlephilhower
board_build.filesystem_size = 0.5m
lib_deps = lib_deps =
; khoih-prog/RP2040_SD@^1.0.1 ; khoih-prog/RP2040_SD@^1.0.1

View File

@ -64,7 +64,7 @@ void init_audio() {
pwm_config_set_clkdiv(&config, AUDIO_CLK_DIV); pwm_config_set_clkdiv(&config, AUDIO_CLK_DIV);
pwm_config_set_wrap(&config, 250); pwm_config_set_wrap(&config, 250);
pwm_init(audio_pin_slice, 0, &config, true); pwm_init(audio_pin_slice, /*0,*/ &config, true);
pwm_set_gpio_level(AUDIO_PIN, 0); pwm_set_gpio_level(AUDIO_PIN, 0);
} }

View File

@ -1,6 +1,5 @@
#include <Arduino.h> #include <Arduino.h>
#include "hardware/gpio.h" #include "hardware/gpio.h"
#include "mbed_wait_api.h"
#include "pico/multicore.h" #include "pico/multicore.h"
#include "hardware/pio.h" #include "hardware/pio.h"
@ -16,8 +15,7 @@ uint row_sm = 255; // invalid
inline void pulsePin(uint8_t pin) { inline void pulsePin(uint8_t pin) {
gpio_put(pin, HIGH); gpio_put(pin, HIGH);
// there are glitches without this (maybe just due to breadboard...) // there are glitches without this (maybe just due to breadboard...)
_NOP(); asm volatile("nop \n nop \n nop");
_NOP();
gpio_put(pin, LOW); gpio_put(pin, LOW);
} }

View File

@ -7,6 +7,7 @@
#define SD_DET_PIN 28 #define SD_DET_PIN 28
/*
#if PIN_SPI_SS != 17 #if PIN_SPI_SS != 17
#error "PIN_SPI_SS must be 17" #error "PIN_SPI_SS must be 17"
#endif #endif
@ -19,15 +20,18 @@
#if PIN_SPI_MISO != 16 #if PIN_SPI_MISO != 16
#error "PIN_SPI_MISO must be 16" #error "PIN_SPI_MISO must be 16"
#endif #endif
*/
void setupSDPins() { void setupSDPins() {
// TODO: Is that even needed if we use built-in SPI? // TODO: Is that even needed if we use built-in SPI?
/*
pinMode(PIN_SPI_MISO, INPUT); pinMode(PIN_SPI_MISO, INPUT);
pinMode(PIN_SPI_SS, OUTPUT); pinMode(PIN_SPI_SS, OUTPUT);
digitalWrite(PIN_SPI_SS, HIGH); digitalWrite(PIN_SPI_SS, HIGH);
pinMode(PIN_SPI_SCK, OUTPUT); pinMode(PIN_SPI_SCK, OUTPUT);
pinMode(PIN_SPI_MOSI, OUTPUT); pinMode(PIN_SPI_MOSI, OUTPUT);
pinMode(SD_DET_PIN, INPUT_PULLUP); pinMode(SD_DET_PIN, INPUT_PULLUP);
*/
} }
bool isSDCardInserted() { bool isSDCardInserted() {
@ -298,6 +302,7 @@ void sd_loadNextAudio() {
} }
bool sd_loadGfxFrameLengths(size_t index) { bool sd_loadGfxFrameLengths(size_t index) {
return false;
/* /*
if (index >= playlistSize) { if (index >= playlistSize) {
Serial.println("Index out of range"); Serial.println("Index out of range");
@ -337,6 +342,7 @@ bool sd_loadGfxFrameLengths(size_t index) {
uint16_t frameIdx = 0; uint16_t frameIdx = 0;
bool sd_loadGfxBlob(size_t index) { bool sd_loadGfxBlob(size_t index) {
return false;
/* /*
if (index >= playlistSize) { if (index >= playlistSize) {
Serial.println("Index out of range"); Serial.println("Index out of range");
@ -361,6 +367,7 @@ bool sd_loadGfxBlob(size_t index) {
// Returns size of frame read or -1 if error // Returns size of frame read or -1 if error
int32_t sd_loadNextFrame() { int32_t sd_loadNextFrame() {
return -1;
/* /*
if (frameIdx > 0) { if (frameIdx > 0) {
// return -1; // return -1;