write diagnostic message if PIC initialization failed
This commit is contained in:
@@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
# can be either "Y" or "N" (without quotes). "Y" for using the m68k-elf-, "N" for using the m68k-atari-mint
|
# can be either "Y" or "N" (without quotes). "Y" for using the m68k-elf-, "N" for using the m68k-atari-mint
|
||||||
# toolchain
|
# toolchain
|
||||||
COMPILE_ELF=N
|
COMPILE_ELF=Y
|
||||||
|
|
||||||
ifeq (Y,$(COMPILE_ELF))
|
ifeq (Y,$(COMPILE_ELF))
|
||||||
TCPREFIX=m68k-elf-
|
TCPREFIX=m68k-elf-
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ static inline bool pic_rxready(void)
|
|||||||
|
|
||||||
void write_pic_byte(uint8_t value)
|
void write_pic_byte(uint8_t value)
|
||||||
{
|
{
|
||||||
/* Wait until the tramsmitter is ready or 1000us are passed */
|
/* Wait until the transmitter is ready or 1000us are passed */
|
||||||
waitfor(1000, pic_txready);
|
waitfor(1000, pic_txready);
|
||||||
|
|
||||||
/* Transmit the byte */
|
/* Transmit the byte */
|
||||||
@@ -75,7 +75,7 @@ uint8_t read_pic_byte(void)
|
|||||||
|
|
||||||
void pic_init(void)
|
void pic_init(void)
|
||||||
{
|
{
|
||||||
char answer[4];
|
char answer[4] = "OLD";
|
||||||
|
|
||||||
xprintf("initialize the PIC: ");
|
xprintf("initialize the PIC: ");
|
||||||
|
|
||||||
@@ -91,7 +91,14 @@ void pic_init(void)
|
|||||||
answer[2] = read_pic_byte();
|
answer[2] = read_pic_byte();
|
||||||
answer[3] = '\0';
|
answer[3] = '\0';
|
||||||
|
|
||||||
xprintf("%s\r\n", answer);
|
if (answer[0] != 'O' || answer[1] != 'K' || answer[2] != '!')
|
||||||
|
{
|
||||||
|
xprintf("PIC initialization failed. Already initialized?\r\n");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
xprintf("%s\r\n", answer);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void nvram_init(void)
|
void nvram_init(void)
|
||||||
@@ -135,7 +142,7 @@ void BaS(void)
|
|||||||
|
|
||||||
if (az_sectors > 0)
|
if (az_sectors > 0)
|
||||||
{
|
{
|
||||||
//sd_card_idle();
|
sd_card_idle();
|
||||||
}
|
}
|
||||||
|
|
||||||
pic_init();
|
pic_init();
|
||||||
|
|||||||
@@ -205,7 +205,21 @@ void sd_card_read_ic(void)
|
|||||||
|
|
||||||
if (rb == 5)
|
if (rb == 5)
|
||||||
{
|
{
|
||||||
; /* sd v1 */
|
while (rb == 5)
|
||||||
|
{
|
||||||
|
rb = sd_send_byte(0xff);
|
||||||
|
rb = sd_send_byte(0x7a);
|
||||||
|
rb = sd_send_byte(0x00);
|
||||||
|
rb = sd_send_byte(0x00);
|
||||||
|
rb = sd_send_byte(0x00);
|
||||||
|
rb = sd_send_byte(0x00);
|
||||||
|
rb = sd_send_byte(0x01);
|
||||||
|
rb = sd_card_get_status();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (rb == 1)
|
||||||
|
{
|
||||||
|
//sd_card_read_ic();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user