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

Provide some missing Arduino macros #16497

Merged
merged 1 commit into from
Jan 8, 2020
Merged
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
18 changes: 18 additions & 0 deletions Marlin/src/feature/dac/dac_mcp4728.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,24 @@

#include <Wire.h>

/**
* The following three macros are only used in this piece of code related to mcp4728.
* They are defined in the standard Arduino framework but could be undefined in 32 bits Arduino frameworks.
* (For instance not defined in Arduino lpc176x framework)
* So we have to define them if needed.
*/
#ifndef word
#define word(h, l) ((uint8_t) ((h << 8) | l))
#endif

#ifndef lowByte
#define lowByte(w) ((uint8_t) ((w) & 0xff))
#endif

#ifndef highByte
#define highByte(w) ((uint8_t) ((w) >> 8))
#endif

#define defaultVDD DAC_STEPPER_MAX //was 5000 but differs with internal Vref
#define BASE_ADDR 0x60
#define RESET 0b00000110
Expand Down