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

[READY] Adding EEPROM read/write functionality #6

Merged
merged 8 commits into from
Jul 31, 2014
Merged

Conversation

johnnyman727
Copy link
Contributor

Adds the following API for reading and writing bytes:

// Read multiple bytes
avr.readEEPROM(numToRead, startAddress, callback(err, bufferRead);

// Write multiple bytes
avr.writeEEPROM(byteArr, startAddress, callback(err));

// Read a single byte
avr.readEEPROMByte(address, callback(err, byteRead)); // callback(err, byteRead)

// Write a single byte
avr.writeEEPROMByte(byte, address, callback(err));

@johnnyman727 johnnyman727 changed the title [NRY] Adding single byte read/writes from eeprom [READY] Adding single byte read/writes from eeprom Jul 31, 2014
@johnnyman727
Copy link
Contributor Author

@EvanSimpson r?

// If this is the last byte
if (i == numBytes-1) {
// Return our successfully read bytes
callback(null, bytes);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (callback)

var address = address & 0xFF;
self.startProgramming(function(err) {
if (err) {
return callback(err);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (callback)

@EvanSimpson
Copy link
Member

One last callback check and then r+

}
self._transfer([command, 0x00, address, data], function(err, response) {
if (err) {
return callback(err);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here too

johnnyman727 added a commit that referenced this pull request Jul 31, 2014
[READY] Adding single byte read/writes from eeprom
@johnnyman727 johnnyman727 merged commit 706993d into master Jul 31, 2014
@Frijol Frijol deleted the jon-eeprom branch July 31, 2014 00:54
@johnnyman727 johnnyman727 changed the title [READY] Adding single byte read/writes from eeprom [READY] Adding EEPROM read/write functionality Jul 31, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants