
21 May
2010
21 May
'10
3:13 p.m.
Dear Delio Brignoli,
In message 25096244-C685-4D68-BBF9-6DF2F154AFB8@audioscience.com you wrote:
Reduce the number of reads per byte transferred on the BUF register from 2 to 1 and take advantage of the TX buffer in the SPI module.
...
/* if data is available */
if ((i_cnt < len) && (buf_reg_val & SPIBUF_RXEMPTY_MASK) == 0) {
/* if there is no read buffer simply ignore the read character */
if(rxp) {
*rxp = buf_reg_val & 0xFF;
rxp++;
}
Please change into:
if (rxp) *rxp++ = buf_reg_val & 0xFF;
if ((o_cnt < len) && ((buf_reg_val & SPIBUF_TXFULL_MASK) == 0)) {
/* write the data */
data1_reg_val &= ~0xFFFF;
if(txp) {
data1_reg_val |= *txp;
txp++;
}
Same here:
if (txp) data1_reg_val |= *txp++; Please fix all other occurrences of "if(" into "if (" as well.
/* write to DAT1 is required to keep the serial transfer going */
/* we just terminate when we reach the end */
Incorrect multiline comment style.
writel(data1_reg_val &
~(1 << SPIDAT1_CSHOLD_SHIFT), &ds->regs->dat1);
Line too long.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
The software required `Windows 95 or better', so I installed Linux.