
19 Aug
2007
19 Aug
'07
7:42 p.m.
+#define BAUDRATE(mck, baud) \
- ((((mck) * 10) % ((baud) * 16)) >= 5) ? \
- (mck / (baud * 16) + 1) : ((mck) / (baud * 16))
void serial_setbrg (void) { int baudrate;
if ((baudrate = gd->baudrate) <= 0) baudrate = CONFIG_BAUDRATE;
- /* MASTER_CLOCK/(16 * baudrate) */
- us->US_BRGR = (AT91C_MASTER_CLOCK >> 4) / (unsigned)baudrate;
- us->US_BRGR = BOUDRATE(AT91C_MASTER_CLOCK, (unsigned)baudrate);
}
int serial_init (void)
Excuse me I take the wrong diff file, containg and error on macro name. I will send the right one soon.
Regards Michael