Fixed rxwm setting as it defines the maximum number of received bytes

*before* the interrupt
This commit is contained in:
Eyck Jentzsch 2018-10-05 12:23:39 +02:00
parent 2a45030414
commit d6db5f7e04

View File

@ -169,7 +169,7 @@ public:
template<size_t SIZE> template<size_t SIZE>
static bool transfer(std::array<uint8_t, SIZE>& bytes){ static bool transfer(std::array<uint8_t, SIZE>& bytes){
csmode_reg().mode=2; // HOLD mode csmode_reg().mode=2; // HOLD mode
rxctrl_reg().rxmark=bytes.size(); // trigger irq if 3 bytes are received; rxctrl_reg().rxmark=bytes.size()-1; // trigger irq if more than 2 bytes are received;
ie_reg().rxwm=1; ie_reg().rxwm=1;
// write data bytes // write data bytes
for(size_t i=0; i<bytes.size(); ++i) for(size_t i=0; i<bytes.size(); ++i)