fixed comments
This commit is contained in:
@@ -57,6 +57,7 @@
|
||||
#else
|
||||
#define dbg(format, arg...) do { ; } while (0)
|
||||
#endif
|
||||
#define err(format, arg...) do { xprintf("ERROR: %s(): " format, __FUNCTION__, ##arg); } while (0)
|
||||
|
||||
/* imported routines */
|
||||
extern int vec_init();
|
||||
@@ -79,7 +80,9 @@ extern uint8_t _EMUTOS_SIZE[];
|
||||
static inline bool pic_txready(void)
|
||||
{
|
||||
if (MCF_PSC3_PSCSR & MCF_PSC_PSCSR_TXRDY)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -90,26 +93,36 @@ static inline bool pic_txready(void)
|
||||
static inline bool pic_rxready(void)
|
||||
{
|
||||
if (MCF_PSC3_PSCSR & MCF_PSC_PSCSR_RXRDY)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void write_pic_byte(uint8_t value)
|
||||
{
|
||||
/* Wait until the transmitter is ready or 1000us are passed */
|
||||
/*
|
||||
* Wait until the transmitter is ready or 1000us are passed
|
||||
*/
|
||||
waitfor(1000, pic_txready);
|
||||
|
||||
/* Transmit the byte */
|
||||
/*
|
||||
* Transmit the byte
|
||||
*/
|
||||
*(volatile uint8_t*)(&MCF_PSC3_PSCTB_8BIT) = value; // Really 8-bit
|
||||
}
|
||||
|
||||
uint8_t read_pic_byte(void)
|
||||
{
|
||||
/* Wait until a byte has been received or 1000us are passed */
|
||||
/*
|
||||
* Wait until a byte has been received or 1000us are passed
|
||||
*/
|
||||
waitfor(1000, pic_rxready);
|
||||
|
||||
/* Return the received byte */
|
||||
/*
|
||||
* Return the received byte
|
||||
*/
|
||||
return * (volatile uint8_t *) (&MCF_PSC3_PSCTB_8BIT); // Really 8-bit
|
||||
}
|
||||
|
||||
@@ -119,13 +132,17 @@ void pic_init(void)
|
||||
|
||||
xprintf("initialize the PIC: ");
|
||||
|
||||
/* Send the PIC initialization string */
|
||||
/*
|
||||
* Send the PIC initialization string
|
||||
*/
|
||||
write_pic_byte('A');
|
||||
write_pic_byte('C');
|
||||
write_pic_byte('P');
|
||||
write_pic_byte('F');
|
||||
|
||||
/* Read the 3-char answer string. Should be "OK!". */
|
||||
/*
|
||||
* Read the 3-char answer string. Should be "OK!".
|
||||
*/
|
||||
answer[0] = read_pic_byte();
|
||||
answer[1] = read_pic_byte();
|
||||
answer[2] = read_pic_byte();
|
||||
|
||||
@@ -182,7 +182,7 @@ int pic_interrupt_handler(void *arg1, void *arg2)
|
||||
uint8_t *rtc_data = (uint8_t *) 0xffff8963;
|
||||
int index = 0;
|
||||
|
||||
xprintf("PIC interrupt: requesting RTC data\r\n");
|
||||
err("PIC interrupt: requesting RTC data\r\n");
|
||||
|
||||
MCF_PSC3_PSCTB_8BIT = 0x82; // header byte to PIC
|
||||
do
|
||||
@@ -305,7 +305,7 @@ bool irq6_handler(uint32_t sf1, uint32_t sf2)
|
||||
|
||||
if (FALCON_MFP_IPRA || FALCON_MFP_IPRB)
|
||||
{
|
||||
blink_led();
|
||||
blink_led();
|
||||
}
|
||||
|
||||
return handled;
|
||||
@@ -328,23 +328,27 @@ void irq7_handler(void)
|
||||
dbg("IRQ7!\r\n");
|
||||
if ((handle = pci_get_interrupt_cause()) > 0)
|
||||
{
|
||||
newvalue = pci_call_interrupt_chain(handle, value);
|
||||
if (newvalue == value)
|
||||
{
|
||||
dbg("interrupt not handled!\r\n");
|
||||
}
|
||||
newvalue = pci_call_interrupt_chain(handle, value);
|
||||
if (newvalue == value)
|
||||
{
|
||||
dbg("interrupt not handled!\r\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif /* MACHINE_M548X */
|
||||
|
||||
#if defined(MACHINE_FIREBEE)
|
||||
/*
|
||||
* Firebee/Falcon Videl registers
|
||||
* TODO: should go into an include file
|
||||
*/
|
||||
#define vbasehi (* (volatile uint8_t *) 0xffff8201)
|
||||
#define vbasemid (* (volatile uint8_t *) 0xffff8203)
|
||||
#define vbaselow (* (volatile uint8_t *) 0xffff820d)
|
||||
|
||||
#define vwrap (* (volatile uint16_t *) 0xffff8210)
|
||||
#define vde (* (volatile uint16_t *) 0xffff82aa)
|
||||
#define vdb (* (volatile uint16_t *) 0xffff82a8)
|
||||
#define vde (* (volatile uint16_t *) 0xffff82aa)
|
||||
#define vdb (* (volatile uint16_t *) 0xffff82a8)
|
||||
|
||||
/*
|
||||
* this is the higlevel interrupt service routine for gpt0 timer interrupts.
|
||||
|
||||
Reference in New Issue
Block a user