CVS: jtag/hardware_access HIL.c,1.5,1.6
Steve Underwood <[email protected]>
| Newsgroups | gmane.comp.hardware.texas-instruments.msp430.gcc.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/mspgcc/jtag/hardware_access
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15049/jtag/hardware_access
Modified Files:
HIL.c
Log Message:
HIL_RST function now follows TI's more recent API
Index: HIL.c
===================================================================
RCS file: /cvsroot/mspgcc/jtag/hardware_access/HIL.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -w -d -r1.5 -r1.6
--- HIL.c 22 Apr 2005 10:27:52 -0000 1.5
+++ HIL.c 6 Jun 2005 12:40:59 -0000 1.6
@@ -895,18 +895,39 @@
Set the state of the device RST pin.
Parameters:
- state: The device RST pin is set to state (0/1).
+ state: The device RST pin is set to state (0, 1, 2, 3).
Returns:
Notes:
+ 1. As implemented, a state == 0 asserts RST (active low), while a state == 1 tri-states RST.
+ Thus, a pull-up resistor on RST is assumed.
+ 2. As implemented, EN_TCLK and RST are negative logic.
*/
void WINAPI HIL_RST(LONG state)
{
- if (state)
- portCtrl &= ~(RST | EN_TCLK); // Disable Reset Driver
- else
- portCtrl |= (RST | EN_TCLK); // Enable Reset Driver
+ switch (state)
+ {
+ case 0:
+ // Enable Reset Driver
+ portCtrl |= RST;
+ portCtrl |= EN_TCLK;
+ break;
+ case 1:
+ // Disable Reset Driver
+ portCtrl &= ~RST;
+ portCtrl &= ~EN_TCLK;
+ break;
+ case 2:
+ // Drive RST high
+ portCtrl &= ~RST;
+ portCtrl |= EN_TCLK;
+ break;
+ default:
+ portCtrl &= ~RST;
+ portCtrl |= EN_TCLK;
+ break;
+ }
#if defined(HIL_PPDEV)
ioctl(fd, PPWCONTROL, &portCtrl);
#else
-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games. How far can you shotput
a projector? How fast can you ride your desk chair down the office luge track?
If you want to score the big prize, get to know the little guy.
Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20