feat: remove RiscVBoard references and related code from various components

pull/47/head
David Montero Crespo 2026-03-18 23:33:20 -03:00
parent 7053b6f2c8
commit 765a3ff711
6 changed files with 4 additions and 33 deletions

View File

@ -16,7 +16,6 @@ import type { BoardKind } from '../types/board';
import { BOARD_KIND_LABELS } from '../types/board';
import raspberryPi3Svg from '../assets/Raspberry_Pi_3_illustration.svg';
import { Attiny85 } from './components-wokwi/Attiny85';
import { RiscVBoard } from './components-wokwi/RiscVBoard';
import './components-wokwi/Esp32Element'; // registers wokwi-esp32
import './components-wokwi/PiPicoWElement'; // registers wokwi-pi-pico-w
import './ComponentPickerModal.css';
@ -46,19 +45,6 @@ const BOARD_DESCRIPTIONS: Record<BoardKind, string> = {
'xiao-esp32-c3': 'Seeed XIAO ESP32-C3 mini board (QEMU)',
'aitewinrobot-esp32c3-supermini': 'ESP32-C3 SuperMini (QEMU)',
'attiny85': '8-bit AVR, 8KB flash, 6 GPIO (browser)',
'riscv-generic': 'RV32EC 48 MHz, 16KB flash, CH32V003 (browser)',
};
const BOARD_COLOR: Record<BoardKind, string> = {
'arduino-uno': '#4af', 'arduino-nano': '#4af', 'arduino-mega': '#4af',
'raspberry-pi-pico': '#4af', 'pi-pico-w': '#4af',
'raspberry-pi-3': '#c22',
'esp32': '#e8a020', 'esp32-devkit-c-v4': '#e8a020', 'esp32-cam': '#e8a020',
'wemos-lolin32-lite': '#e8a020',
'esp32-s3': '#e8a020', 'xiao-esp32-s3': '#e8a020', 'arduino-nano-esp32': '#4af',
'esp32-c3': '#e8a020', 'xiao-esp32-c3': '#e8a020',
'aitewinrobot-esp32c3-supermini': '#e8a020',
'attiny85': '#4af', 'riscv-generic': '#4a4',
};
const ALL_BOARDS: BoardKind[] = [
@ -67,7 +53,7 @@ const ALL_BOARDS: BoardKind[] = [
'esp32', 'esp32-devkit-c-v4', 'esp32-cam', 'wemos-lolin32-lite',
'esp32-s3', 'xiao-esp32-s3', 'arduino-nano-esp32',
'esp32-c3', 'xiao-esp32-c3', 'aitewinrobot-esp32c3-supermini',
'attiny85', 'riscv-generic',
'attiny85',
];
export const ComponentPickerModal: React.FC<ComponentPickerModalProps> = ({
@ -365,7 +351,7 @@ const BoardCard: React.FC<BoardCardProps> = ({ kind, onSelect }) => {
React.useEffect(() => {
if (!thumbnailRef.current) return;
// React-rendered boards and Pi3 handled in JSX below
if (kind === 'raspberry-pi-3' || kind === 'attiny85' || kind === 'riscv-generic') return;
if (kind === 'raspberry-pi-3' || kind === 'attiny85') return;
const tag = BOARD_TAG[kind];
if (!tag) return;
@ -389,10 +375,6 @@ const BoardCard: React.FC<BoardCardProps> = ({ kind, onSelect }) => {
<div style={{ transform: 'scale(0.55)', transformOrigin: 'center center' }}>
<Attiny85 />
</div>
) : kind === 'riscv-generic' ? (
<div style={{ transform: 'scale(0.42)', transformOrigin: 'center center' }}>
<RiscVBoard />
</div>
) : null;
return (

View File

@ -7,7 +7,6 @@ import { NanoRP2040 } from '../components-wokwi/NanoRP2040';
import { RaspberryPi3 } from '../components-wokwi/RaspberryPi3';
import { Esp32 } from '../components-wokwi/Esp32';
import { Attiny85 } from '../components-wokwi/Attiny85';
import { RiscVBoard } from '../components-wokwi/RiscVBoard';
import { PiPicoW } from '../components-wokwi/PiPicoW';
import { PinOverlay } from './PinOverlay';
@ -32,7 +31,6 @@ const BOARD_SIZE: Record<string, { w: number; h: number }> = {
'xiao-esp32-c3': { w: 91, h: 117 },
'aitewinrobot-esp32c3-supermini': { w: 90, h: 123 },
'attiny85': { w: 160, h: 100 },
'riscv-generic': { w: 200, h: 140 },
};
interface BoardOnCanvasProps {
@ -89,8 +87,6 @@ export const BoardOnCanvas = ({
return <Esp32 id={id} x={x} y={y} boardKind={boardKind} />;
case 'attiny85':
return <Attiny85 id={id} x={x} y={y} led1={led13} />;
case 'riscv-generic':
return <RiscVBoard id={id} x={x} y={y} ledBuiltIn={led13} />;
}
})();

View File

@ -66,8 +66,6 @@ function getPinsForBoardKind(boardKind: BoardKind): { pin: number; label: string
case 'xiao-esp32-c3':
case 'aitewinrobot-esp32c3-supermini':
return Array.from({ length: 22 }, (_, i) => ({ pin: i, label: `GPIO${i}` }));
case 'riscv-generic':
return Array.from({ length: 20 }, (_, i) => ({ pin: i, label: `D${i}` }));
case 'raspberry-pi-3':
return Array.from({ length: 28 }, (_, i) => ({ pin: i, label: `GPIO${i}` }));
default:

View File

@ -176,8 +176,6 @@ function createSimulator(
sim = new AVRSimulator(pm, 'mega');
} else if (boardKind === 'attiny85') {
sim = new AVRSimulator(pm, 'tiny85');
} else if (boardKind === 'riscv-generic') {
sim = new RiscVSimulator(pm);
} else if (boardKind === 'raspberry-pi-pico' || boardKind === 'pi-pico-w') {
sim = new RP2040Simulator(pm);
} else if (isRiscVEsp32Kind(boardKind)) {

View File

@ -15,8 +15,7 @@ export type BoardKind =
| 'esp32-c3' // RISC-V RV32IMC, browser emulation (Esp32C3Simulator)
| 'xiao-esp32-c3' // Seeed XIAO ESP32-C3, browser emulation (Esp32C3Simulator)
| 'aitewinrobot-esp32c3-supermini' // ESP32-C3 SuperMini, browser emulation (Esp32C3Simulator)
| 'attiny85' // AVR ATtiny85, browser emulation (avr8js)
| 'riscv-generic'; // RV32I generic MCU (CH32V003 target), browser emulation
| 'attiny85'; // AVR ATtiny85, browser emulation (avr8js)
export interface BoardInstance {
id: string; // unique in canvas, e.g. 'arduino-uno', 'raspberry-pi-3'
@ -49,7 +48,6 @@ export const BOARD_KIND_LABELS: Record<BoardKind, string> = {
'xiao-esp32-c3': 'XIAO ESP32-C3',
'aitewinrobot-esp32c3-supermini': 'ESP32-C3 SuperMini',
'attiny85': 'ATtiny85',
'riscv-generic': 'RISC-V RV32 (CH32V003)',
};
export const BOARD_KIND_FQBN: Record<BoardKind, string | null> = {
@ -70,5 +68,4 @@ export const BOARD_KIND_FQBN: Record<BoardKind, string | null> = {
'xiao-esp32-c3': 'esp32:esp32:XIAO_ESP32C3',
'aitewinrobot-esp32c3-supermini': 'esp32:esp32:esp32c3',
'attiny85': 'ATTinyCore:avr:attinyx5:chip=85,clock=internal16mhz',
'riscv-generic': null,
};

View File

@ -146,7 +146,7 @@ export const BOARD_COMPONENT_IDS = [
'esp32', 'esp32-devkit-c-v4', 'esp32-cam', 'wemos-lolin32-lite',
'esp32-s3', 'xiao-esp32-s3', 'arduino-nano-esp32',
'esp32-c3', 'xiao-esp32-c3', 'aitewinrobot-esp32c3-supermini',
'attiny85', 'riscv-generic',
'attiny85',
];
/**