Skip to content

Remove I2C buffer length limitation required by M24SR64-Y library #120

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libraries/Wire/Wire.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ uint8_t TwoWire::requestFrom(uint8_t address, uint8_t quantity, uint32_t iaddres
}

// clamp to buffer length
if(quantity > BUFFER_LENGTH){
if(quantity >= BUFFER_LENGTH){
quantity = BUFFER_LENGTH;
}
// perform blocking read into buffer
Expand Down
3 changes: 3 additions & 0 deletions libraries/Wire/Wire.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@
#include "Stream.h"
#include "variant.h"

// Defines a default buffer length
#ifndef BUFFER_LENGTH
#define BUFFER_LENGTH 32
#endif

#define MASTER_ADDRESS 0x33

Expand Down
2 changes: 2 additions & 0 deletions variants/DISCO_L475VG_IOT/variant.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ enum {
#define SDA 14
#define SCL 15

#define BUFFER_LENGTH 255 //Define I2C maximum buffer length

//Timer Definitions
//Do not use timer used by PWM pins when possible. See PinMap_PWM.
#define TIMER_TONE TIM6
Expand Down