Platform/ECM3532/DSP/hw/csp/ecm3532/src/eta_csp_io.c
/***************************************************************************/
/**
 *
 *  eta_csp_printviam3_putc - PUTC variant of printf specific for Print via M3
 *
 *  @param ui8Byte - character to print
 *
 *  Note this funciton will stall until space is available in the buffer and
 *  may stall forever if space is never available.
 *
 ******************************************************************************/
PUTC variant of printf specific for Print via M3
@param ui8Byte - character to print

Note this funciton will stall until space is available in the buffer and
may stall forever if space is never available.
PUTC variant of printf specific for Print via M3 @param ui8Byte - character to print Note this funciton will stall until space is available in the buffer and may stall forever if space is never available .
void
eta_csp_printviam3_putc(uchar ui8Byte)
{
    int new_wrptr;
    int byteaddress;
    int mailbox_16bit_message;
    uint32_t mbox_message;
    uchar tempchar;
    new_wrptr = eta_csp_printviam3_inc_indx(glob_printbuff_wrptr);
    while(new_wrptr == glob_printbuff_rdptr) 
    {
    }
    glob_printbuff_data [glob_printbuff_wrptr] = ui8Byte;
    glob_printbuff_wrptr = eta_csp_printviam3_inc_indx(glob_printbuff_wrptr);
}
void eta_csp_printviam3_putc ( uchar ui8Byte ) { int new_wrptr ; int byteaddress ; int mailbox_16bit_message ; uint32_t mbox_message ; uchar tempchar ; new_wrptr = eta_csp_printviam3_inc_indx ( glob_printbuff_wrptr ) ; while ( new_wrptr == glob_printbuff_rdptr ) { } glob_printbuff_data [ glob_printbuff_wrptr ] = ui8Byte ; glob_printbuff_wrptr = eta_csp_printviam3_inc_indx ( glob_printbuff_wrptr ) ; }
eta_csp_printviam3_putc - PUTC variant of printf specific for Print via M3
  @param ui8Byte - character to print
eta_csp_printviam3_putc - PUTC variant of printf specific for Print via M3 @param ui8Byte - character to print
// If we get to end of DSP buffer, we jump back to the beginning. // We "hardcode" a constant at the end of the buffer that is the // "stop, jump back to address xyz" so from putc perspective, we // simply push onto circular buffer. // He we check to make sure we have space to print. If we don't, we stall. // OPTME, permenant silent stall... what can we do better here? // We could print to the DSP/DEBUG UART, but there is no reasonable // expected time that the M3 would print (M3 may be busy). Maybe we could // wait 1 sec, but we have no mechanism to determine what 1 sec is, so // we'd have to assume 1 sec at slowest and fastest DSP freq, which is a // timeout of 100s of millions of counts.... feels like a cluster to // do nothing but maybe print if we are enabled... leave as is. // Stall forever (interrupt should // replenish credits)