Update of /cvsroot/firebug/mts400/sensors/i2c
In directory sc8-pr-cvs1:/tmp/cvs-serv1851/mts400/sensors/i2c
Modified Files:
SODebug.h
Log Message:
Added some more testing files to the fireboard driver.
Index: SODebug.h
===================================================================
RCS file: /cvsroot/firebug/mts400/sensors/i2c/SODebug.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** SODebug.h 12 Nov 2003 23:52:42 -0000 1.1
--- SODebug.h 27 Nov 2003 00:04:28 -0000 1.2
***************
*** 12,15 ****
--- 12,16 ----
//init comm port (56K baud, mica2 only, use 19K baud for mica2dot, mica....) for debug
// call this from startup routine
+ // Consider making this call idempotent
void init_debug(){
outp(0,UBRR0H);
***************
*** 20,24 ****
outp((1 << TXEN) ,UCSR0B); // Enable uart reciever and transmitter
}
!
//init comm port (19K baud) for mica2dot for debug
// call this from startup routine
--- 21,25 ----
outp((1 << TXEN) ,UCSR0B); // Enable uart reciever and transmitter
}
!
//init comm port (19K baud) for mica2dot for debug
// call this from startup routine
***************
*** 31,51 ****
outp((1 << TXEN) ,UCSR0B);
}
!
! // output a char to the uart
! void UARTPutChar(char c) {
! if (c == '\n')
! UARTPutChar('\r');
! loop_until_bit_is_set(UCSR0A, UDRE);
! outb(UDR0,c);
! }
!
! void writedebug() {
int i = 0;
! UARTPutChar('\n'); //write a carriage return 1st
! while (debugbuf[i] != '\n')
! UARTPutChar(debugbuf[i++]);
! // UARTPutChar('\n');
!
! }
#define SPRINTF //use this sprintf function
#ifdef SPRINTF
--- 32,52 ----
outp((1 << TXEN) ,UCSR0B);
}
!
! // output a char to the uart
! void UARTPutChar(char c) {
! if (c == '\n')
! UARTPutChar('\r');
! loop_until_bit_is_set(UCSR0A, UDRE);
! outb(UDR0,c);
! }
!
! void writedebug() {
int i = 0;
! UARTPutChar('\n'); //write a carriage return 1st
! while (debugbuf[i] != '\n')
! UARTPutChar(debugbuf[i++]);
! // UARTPutChar('\n');
!
! }
#define SPRINTF //use this sprintf function
#ifdef SPRINTF
***************
*** 123,140 ****
#define SO_NO_DEBUG 0
#define SO_DEBUG //turn on debug output
! #ifdef SO_DEBUG
! #define SODbg(__x,__args...) { \
! char bStatus; \
if(__x != SO_NO_DEBUG){ \
! bStatus=bit_is_set(SREG,7); \
! cli(); \
sprintf(debugbuf,__args); \
! writedebug(); \
! if (bStatus) sei(); \
} \
! }
#else
#define SODbg(__x,__args...)
! #endif
!
!
--- 124,141 ----
#define SO_NO_DEBUG 0
#define SO_DEBUG //turn on debug output
! #ifdef SO_DEBUG
! #define SODbg(__x,__args...) { \
! char bStatus; \
if(__x != SO_NO_DEBUG){ \
! bStatus=bit_is_set(SREG,7); \
! cli(); \
sprintf(debugbuf,__args); \
! writedebug(); \
! if (bStatus) sei(); \
} \
! }
#else
#define SODbg(__x,__args...)
! #endif
!
!
|