Adjusted to the current A2retroNET hardware.

This commit is contained in:
Oliver Schmidt 2023-07-15 20:13:23 +02:00
parent 0424d43e0a
commit e26dff7f5f
4 changed files with 4 additions and 32 deletions

View File

@ -30,7 +30,7 @@ SOFTWARE.
extern const __attribute__((aligned(4))) uint8_t firmware[];
volatile bool active;
static bool active;
static uint32_t command;
static uint32_t control;

View File

@ -27,8 +27,6 @@ SOFTWARE.
#ifndef _BOARD_H
#define _BOARD_H
extern volatile bool active;
void board(void);
#endif

View File

@ -31,9 +31,9 @@ SOFTWARE.
.define public gpio_addr 2 // 12 pins
.define public gpio_rw 14
.define public gpio_data 15 // 8 pins
.define public gpio_enbl 26 // DEVSEL | IOSEL | IOSTRB
.define public gpio_irq 27
.define public gpio_res 28
.define public gpio_enbl 23 // DEVSEL | IOSEL | IOSTRB
.define public gpio_irq 24
.define public gpio_res 25
.define public size_addr 13 // incl. R/W
.define public size_data 8

View File

@ -28,9 +28,6 @@ SOFTWARE.
#include "pico/printf.h"
#include "pico/stdlib.h"
#include "pico/multicore.h"
#ifdef RASPBERRYPI_PICO_W
#include "pico/cyw43_arch.h"
#endif
#include "bus.pio.h"
#include "board.h"
@ -49,25 +46,12 @@ void uart_printf(uart_inst_t *uart, const char *format, ...) {
}
#endif
void res_callback(uint gpio, uint32_t events) {
}
void main(void) {
multicore_launch_core1(board);
#ifdef RASPBERRYPI_PICO_W
cyw43_arch_init();
#elif defined(PICO_DEFAULT_LED_PIN)
gpio_init(PICO_DEFAULT_LED_PIN);
gpio_set_dir(PICO_DEFAULT_LED_PIN, GPIO_OUT);
#endif
gpio_init(gpio_irq);
gpio_pull_up(gpio_irq);
gpio_init(gpio_res);
gpio_set_irq_enabled_with_callback(gpio_res, GPIO_IRQ_EDGE_RISE, true, &res_callback);
stdio_init_all();
stdio_set_translate_crlf(&stdio_usb, false);
@ -96,15 +80,5 @@ void main(void) {
#endif
}
}
#ifdef RASPBERRYPI_PICO_W
static bool last_active;
if (active != last_active) {
cyw43_arch_gpio_put(CYW43_WL_GPIO_LED_PIN, active);
last_active = active;
}
#elif defined(PICO_DEFAULT_LED_PIN)
gpio_put(PICO_DEFAULT_LED_PIN, active);
#endif
}
}