@@ -169,12 +169,6 @@ void noteTransactionStop (void) {
169169 @param assignCallbacks
170170 When `true` the system callbacks will be assigned,
171171 when `false` the system callbacks will be cleared.
172- @param i2cmax
173- The max length of each message to send from the host to
174- the Notecard. Used to ensure the messages are sized appropriately
175- for the host.
176- @param wirePort
177- The TwoWire implementation to use for I2C communication.
178172*/
179173/* *************************************************************************/
180174void Notecard::platformInit (bool assignCallbacks)
@@ -183,7 +177,7 @@ void Notecard::platformInit (bool assignCallbacks)
183177 if (assignCallbacks) {
184178 NoteSetFnDefault (malloc, free, noteDelay, noteMillis);
185179 } else {
186- NoteSetFnDefault (nullptr , nullptr , nullptr , nullptr );
180+ NoteSetFn (nullptr , nullptr , nullptr , nullptr ); // Force clear
187181 }
188182}
189183
@@ -210,21 +204,23 @@ Notecard::~Notecard (void)
210204 communicating with the Notecard from the host.
211205 @param i2cAddress
212206 The I2C Address to use for the Notecard.
213- @param i2cMax
207+ @param i2cMtu
214208 The max length of each message to send from the host
215209 to the Notecard. Used to ensure the messages are sized
216210 appropriately for the host.
217211*/
218212/* *************************************************************************/
219- void Notecard::begin (NoteI2c * noteI2c_, uint32_t i2cAddress_, uint32_t i2cMax_ )
213+ void Notecard::begin (NoteI2c * noteI2c_, uint32_t i2cAddress_, uint32_t i2cMtu_ )
220214{
221215 noteI2c = noteI2c_;
222216 platformInit (noteI2c);
223217 if (noteI2c) {
224- NoteSetFnI2C (i2cAddress_, i2cMax_, noteI2cReset,
225- noteI2cTransmit, noteI2cReceive);
218+ NoteSetI2CAddress (i2cAddress_); // Force set user supplied address
219+ NoteSetI2CMtu (i2cMtu_); // Force set user supplied MTU
220+ NoteSetFnI2CDefault (i2cAddress_, i2cMtu_, noteI2cReset,
221+ noteI2cTransmit, noteI2cReceive);
226222 } else {
227- NoteSetFnI2C (0 , 0 , nullptr , nullptr , nullptr );
223+ NoteSetFnI2C (0 , 0 , nullptr , nullptr , nullptr ); // Force clear
228224 }
229225}
230226
@@ -243,10 +239,10 @@ void Notecard::begin(NoteSerial * noteSerial_)
243239 noteSerial = noteSerial_;
244240 platformInit (noteSerial);
245241 if (noteSerial) {
246- NoteSetFnSerial (noteSerialReset, noteSerialTransmit,
247- noteSerialAvailable, noteSerialReceive);
242+ NoteSetFnSerialDefault (noteSerialReset, noteSerialTransmit,
243+ noteSerialAvailable, noteSerialReceive);
248244 } else {
249- NoteSetFnSerial (nullptr , nullptr , nullptr , nullptr );
245+ NoteSetFnSerial (nullptr , nullptr , nullptr , nullptr ); // Force clear
250246 }
251247}
252248
0 commit comments