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

Add portability to 32-bit processors #3

Open
wants to merge 2 commits into
base: master
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
4 changes: 2 additions & 2 deletions src/SFE_HMC6343.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ void SFE_HMC6343::readTilt()
// Generic function which sends the HMC6343 a specified command
// It then collects 6 bytes of data via I2C and consolidates it into three integers
// whose addresses are passed to the function by the above read commands
void SFE_HMC6343::readGeneric(uint8_t command, int* first, int* second, int* third)
void SFE_HMC6343::readGeneric(uint8_t command, int16_t* first, int16_t* second, int16_t* third)
{
sendCommand(command); // Send specified I2C command to HMC6343
delay(1); // Delay response time
Expand Down Expand Up @@ -236,4 +236,4 @@ void SFE_HMC6343::clearRawData()
{
rawData[i] = 0;
}
}
}
12 changes: 6 additions & 6 deletions src/SFE_HMC6343.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ class SFE_HMC6343
SFE_HMC6343();
~SFE_HMC6343();

int heading, pitch, roll;
int magX, magY, magZ;
int accelX, accelY, accelZ;
int temperature;
int16_t heading, pitch, roll;
int16_t magX, magY, magZ;
int16_t accelX, accelY, accelZ;
int16_t temperature;

bool init();

Expand Down Expand Up @@ -116,7 +116,7 @@ class SFE_HMC6343
void clearRawData();

void sendCommand(uint8_t command);
void readGeneric(uint8_t command, int* first, int* second, int* third);
void readGeneric(uint8_t command, int16_t* first, int16_t* second, int16_t* third);
};

#endif
#endif