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.
Fork of PMRC4ch by
Diff: PMRC16ch.cpp
- Revision:
- 20:26972de3cf90
- Parent:
- 18:049283936e3f
- Child:
- 21:fa067e2a30f2
--- a/PMRC16ch.cpp Tue Jun 26 13:14:16 2018 +0000 +++ b/PMRC16ch.cpp Thu Jun 28 08:49:54 2018 +0000 @@ -43,32 +43,24 @@ m_PMRC_POL = Cathodic; } -char PMRC16ch::allGround() +void PMRC16ch::allGround() { if (m_PMRC_state == ALLGROUND) return 1; sweep(); upload(); - return static_cast<char>(m_PMRC_state = ALLGROUND); } -char PMRC16ch::setCh(State arg_state, Polarity arg_POL) +void PMRC16ch::allHiZ() { - m_PMRC_POL = arg_POL; - int num_of_shift = static_cast<int>(arg_state) - static_cast<int>(m_PMRC_state); + //reset shiftresister + m_CLR = 0; + update(); + //enable insertion data to SR + m_CLR = 1; + upload(); +} - if( num_of_shift < 0 ) - sweep(); - - if( m_PMRC_state == ALLGROUND ) { - setStimbits(); - num_of_shift = static_cast<char>(arg_state - 1); - } - shiftby(num_of_shift); - upload(); - - return static_cast<char>(m_PMRC_state = arg_state); -} -char PMRC16ch::setCh(char arg_state, Polarity arg_POL) +void PMRC16ch::setCh(char arg_state, Polarity arg_POL) { m_PMRC_POL = arg_POL; int8_t num_of_shift = arg_state - static_cast<int8_t>(m_PMRC_state); @@ -86,16 +78,6 @@ return static_cast<char>(m_PMRC_state = static_cast<State>(arg_state)); } -void PMRC16ch::allHiZ() -{ - //reset shiftresister - m_CLR = 0; - update(); - //enable insertion data to SR - m_CLR = 1; - upload(); -} - void PMRC16ch::setBits(const uint32_t bits, int num_of_bits, Polarity arg_POL) { m_PMRC_POL = arg_POL;