Skip to content
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

fix the issue of conflicting types that occur with ArduinoCore-samd, … #18

Open
wants to merge 1 commit into
base: public
Choose a base branch
from
Open
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
8 changes: 4 additions & 4 deletions MPR121/MPR121.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ void MPR121_type::setRegister(uint8_t reg, uint8_t value){
}

uint8_t MPR121_type::getRegister(uint8_t reg){
uint8_t scratch;
uint8_t scratch = 0;

Wire.beginTransmission(address);
Wire.write(reg); // set address to read from our requested register
Expand Down Expand Up @@ -786,7 +786,7 @@ void MPR121_type::pinMode(uint8_t electrode, mpr121_pinf_type mode){
uint8_t bitmask = 1<<(electrode-4);

switch(mode){
case INPUT_PULLDOWN:
case mpr121_pinf_type::INPUT_PULLDOWN:
// MPR121_EN = 1
// MPR121_DIR = 0
// MPR121_CTL0 = 1
Expand All @@ -797,7 +797,7 @@ void MPR121_type::pinMode(uint8_t electrode, mpr121_pinf_type mode){
setRegister(MPR121_CTL1, getRegister(MPR121_CTL1) & ~bitmask);
break;

case OUTPUT_HIGHSIDE:
case mpr121_pinf_type::OUTPUT_HIGHSIDE:
// MPR121_EN = 1
// MPR121_DIR = 1
// MPR121_CTL0 = 1
Expand All @@ -808,7 +808,7 @@ void MPR121_type::pinMode(uint8_t electrode, mpr121_pinf_type mode){
setRegister(MPR121_CTL1, getRegister(MPR121_CTL1) | bitmask);
break;

case OUTPUT_LOWSIDE:
case mpr121_pinf_type::OUTPUT_LOWSIDE:
// MPR121_EN = 1
// MPR121_DIR = 1
// MPR121_CTL0 = 1
Expand Down
2 changes: 1 addition & 1 deletion MPR121/MPR121.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ struct MPR121_settings_type
};

// GPIO pin function constants
enum mpr121_pinf_type
enum class mpr121_pinf_type
{
// INPUT and OUTPUT (and others) are already defined by Arduino, use its definitions if they exist
#ifndef INPUT
Expand Down
3 changes: 2 additions & 1 deletion MPR121/MPR121_Datastream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,13 @@ void reset() {
#endif
}

char *splitString(char *data, char *separator, int index) {
char *splitString(char *data, const char *separator, int index) {
char *act, *sub, *ptr;
static char copy[255];
int i;

strcpy(copy, data);
sub = copy; // to supress the warning

for (i = 0, act = copy; i <= index; i++, act = NULL) {
sub = strtok_r(act, separator, &ptr);
Expand Down