Printer mostly working over IEC

Seems to be a problem with iecll_unlisten hanging.
This commit is contained in:
Peter Weingartner 2024-08-05 16:24:32 -04:00
parent 5cf53976c5
commit 5955588c9d
6 changed files with 72 additions and 3 deletions

View file

@ -8,3 +8,11 @@ $F0_1D60 - $F0_1D7F - Wiznet Copper SPI Interface
$F0_1D80 - $F0_1D9F - Wiznet WIFI UART interface (115K or 2M)
$F0_1DA0 - $F0_1DBF - MIDI UART (Fixed @ 31,250Baud)
$F0_1DC0 - $F0_1DDF - Master SPI Interface to Supervisor (RP2040)*
/* SPI Controler 0 Registers - External Access (Front of Unit)*/
#define SD0_CTRL (*(volatile __far uint8_t *)0xF01D00)
#define SD0_DATA (*(volatile __far uint8_t *)0xF01D01)
/* SPI Controler 1 Registers - Internal Access (underneath of Unit - uSDCard) */
// Specific to the F256xE - Internal SDCard (Permanent Disk)
#define SD1_CTRL (*(volatile __far uint8_t *)0xF01D20) <----
#define SD1_DATA (*(volatile __far uint8_t *)0xF01D21) <----

35
src/C256/flash-f256.scm Normal file
View file

@ -0,0 +1,35 @@
(define memories
'((memory flash (address (#xf80000 . #xffffff))
(fill 0)
(section
(LoCodeStorage #xffe000)
(VectorStorage #xffffe0)))
(memory DirectPage (address (#x00c000 . #x00c0ff))
(section (registers ztiny)))
(memory LoRAM (address (#x00c100 . #x00efff))
(section stack data zdata data heap))
(memory NearRAM1 (address (#x050000 . #x057fff))
(section znear near))
(memory NearRAM2 (address (#x058000 . #x05ffff))
(section cnear))
(memory FarRAM1 (address (#x060000 . #x06ffff))
(section far huge))
(memory FarRAM2 (address (#x070000 . #x07ffff))
(section zfar zhuge))
(memory LoCode (address (#x00e000 . #x00ffdf))
(scatter-to LoCodeStorage)
(section code cdata (jumptable #x00e000)))
(memory Vector (address (#x00ffe0 . #x00ffff))
(scatter-to VectorStorage)
(section (reset #xfffc)))
(memory HiCode1 (address (#xf80000 . #xf8ffff))
(section cfar switch data_init_table ifar farcode))
(memory HiCode2 (address (#xf90000 . #xf9ffff))
(section cfar switch data_init_table ifar farcode))
(memory HiCode3 (address (#xfa0000 . #xfaffff))
(section cfar switch data_init_table ifar farcode))
(block stack (size #x1000))
(block heap (size #x1000))
(base-address _DirectPageStart DirectPage 0)
(base-address _NearBaseAddress NearRAM1 0)
))

View file

@ -62,6 +62,13 @@ loop$ lda IEC_INPUT_PORT
pla
rts
.endm
emit: .macro char
pha
lda #(\char)
sta long: 0xf04000
pla
.endm
;;
;; Private functions

View file

@ -26,6 +26,20 @@ void iec_close(uint8_t device, uint8_t channel) {
iecll_unlisten();
}
void iec_print(uint8_t device, char * message) {
// Open the device, channel 1
uint8_t channel = 1;
iecll_listen(device);
iecll_listen_sa(0x60 | channel);
for (char *x = message; *x; x++) {
iecll_out(*x);
}
iecll_unlisten();
iec_close(4, channel);
}
/**
* @brief Retrieve the raw status string from an IEC device
*

View file

@ -14,6 +14,8 @@
#include <stdint.h>
extern void iec_print(uint8_t device, char * message);
/**
* @brief Retrieve the raw status string from an IEC device
*

View file

@ -493,10 +493,13 @@ int main(int argc, char * argv[]) {
printf("Error initializing IEC.\n");
}
printf("Attempting to get status for IEC drive #8: ");
short n = iec_status(8, message, 256);
// printf("Attempting to get status for IEC drive #8: ");
// short n = iec_status(8, message, 256);
// printf("\"%s\"\n", message);
printf("\"%s\"\n", message);
printf("Attempting to write to the printer.\n");
iec_print(4, "\e1THIS IS PRINTED FROM AN F256K OVER THE IEC PORT!\r");
printf("Done.\n");
// Attempt to start up the user code
// log(LOG_INFO, "Looking for user startup code:");