Implementation of 1-Wire with added Alarm Search Functionality
Dependents: Max32630_One_Wire_Interface
Diff: OneWire_Switches/DS2413/ds2413.cpp
- Revision:
- 56:be69bd88a3e3
- Parent:
- 54:08985bf69691
--- a/OneWire_Switches/DS2413/ds2413.cpp Wed Apr 13 20:35:00 2016 +0000 +++ b/OneWire_Switches/DS2413/ds2413.cpp Wed Apr 13 20:40:49 2016 +0000 @@ -162,7 +162,6 @@ //********************************************************************* Ds2413::CmdResult Ds2413::pio_access_write(RomId & romId, uint8_t val) { - static uint32_t cnt = 0; Ds2413::CmdResult result = Ds2413::OpFailure; OneWireMaster::CmdResult ow_result = _owm.OWMatchROM(romId); @@ -176,21 +175,14 @@ { uint8_t expected_status = ((0x01 & val) | ((0x01 & val) << 1) | ((0x02 & val) << 1) | ((0x02 & val) << 2)); - //expected_status |= (~expected_status << 4); uint8_t rcv_block[2]; ow_result = _owm.OWReadBlock(rcv_block, 2); if(ow_result == OneWireMaster::Success) { - printf("\nEntry %d", ++cnt); - printf("\nval = 0x%2x", val); - printf("\nexpected status = 0x%2x", expected_status); - printf("\nrecv_block 0 = 0x%2x", rcv_block[0]); - printf("\nrecv_block 1 = 0x%2x\n", rcv_block[1]); if((rcv_block[0] == 0xAA) && ((rcv_block[1] & 0x0F) == expected_status)) { - printf("\nExit %d\n", cnt); result = Ds2413::Success; } }