Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: mbedlnk.cpp
- Revision:
- 1:dcf2f8359398
- Parent:
- 0:70c3bea805ee
--- a/mbedlnk.cpp Tue Nov 30 22:11:18 2010 +0000 +++ b/mbedlnk.cpp Wed Dec 08 21:23:21 2010 +0000 @@ -40,12 +40,15 @@ // multiple ports. // -#include "./Headers/ownet.h" +#include "onewire_config.h" + +#include "ownet.h" #include "mbed.h" #include <string> using namespace std; -Serial comport(p9, p10); // tx, rx + +Serial comport( ONEWIRE_TX , ONEWIRE_RX ); // tx, rx // exportable functions required @@ -110,6 +113,16 @@ { portnum = 1; } + + if ( port_zstr[0] == '2') + { + portnum = 2; + } + + if ( port_zstr[0] == '3') + { + portnum = 3; + } if(!OpenCOM(portnum, port_zstr)) { @@ -327,8 +340,8 @@ // add adapter specific code here return TRUE; } -*/ -/* + + //-------------------------------------------------------------------------- // Send 8 bits of communication to the 1-Wire Net and verify that the // 8 bits read from the 1-Wire Net is the same (write operation). @@ -345,7 +358,7 @@ SMALLINT owWriteBytePower(int portnum, SMALLINT sendbyte) { // replace if platform has better implementation (faster response) - if (!hasPowerDelivery(portnum)) + if (!owHasPowerDelivery(portnum)) return FALSE; if(owTouchByte(portnum,sendbyte) != sendbyte) @@ -356,8 +369,8 @@ return TRUE; } -*/ -/* + + //-------------------------------------------------------------------------- // Send 1 bit of communication to the 1-Wire Net and verify that the // response matches the 'applyPowerResponse' bit and apply power delivery @@ -375,7 +388,7 @@ SMALLINT owReadBitPower(int portnum, SMALLINT applyPowerResponse) { // replace if platform has better implementation (faster response) - if (!hasPowerDelivery(portnum)) + if (!owHasPowerDelivery(portnum)) return FALSE; if(owTouchBit(portnum,0x01) != applyPowerResponse) @@ -386,4 +399,5 @@ return TRUE; } -*/ + +*/ \ No newline at end of file