Change boolean to bool, byte to uint8_t

This commit is contained in:
Scott Allen 2016-06-15 14:15:47 -04:00
parent f7915cd0a9
commit 0e89bcdf2e
2 changed files with 11 additions and 11 deletions

View File

@ -183,7 +183,7 @@ void Arduboy2Base::initRandomSeed()
power_adc_disable(); // ADC off power_adc_disable(); // ADC off
} }
uint16_t Arduboy2Base::rawADC(byte adc_bits) uint16_t Arduboy2Base::rawADC(uint8_t adc_bits)
{ {
ADMUX = adc_bits; ADMUX = adc_bits;
// we also need MUX5 for temperature check // we also need MUX5 for temperature check
@ -367,7 +367,7 @@ void Arduboy2Base::drawLine
(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint8_t color) (int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint8_t color)
{ {
// bresenham's algorithm - thx wikpedia // bresenham's algorithm - thx wikpedia
boolean steep = abs(y1 - y0) > abs(x1 - x0); bool steep = abs(y1 - y0) > abs(x1 - x0);
if (steep) { if (steep) {
swap(x0, y0); swap(x0, y0);
swap(x1, y1); swap(x1, y1);
@ -733,12 +733,12 @@ unsigned char* Arduboy2Base::getBuffer()
return sBuffer; return sBuffer;
} }
boolean Arduboy2Base::pressed(uint8_t buttons) bool Arduboy2Base::pressed(uint8_t buttons)
{ {
return (buttonsState() & buttons) == buttons; return (buttonsState() & buttons) == buttons;
} }
boolean Arduboy2Base::notPressed(uint8_t buttons) bool Arduboy2Base::notPressed(uint8_t buttons)
{ {
return (buttonsState() & buttons) == 0; return (buttonsState() & buttons) == 0;
} }
@ -792,7 +792,7 @@ size_t Arduboy2::write(uint8_t c)
void Arduboy2::drawChar void Arduboy2::drawChar
(int16_t x, int16_t y, unsigned char c, uint8_t color, uint8_t bg, uint8_t size) (int16_t x, int16_t y, unsigned char c, uint8_t color, uint8_t bg, uint8_t size)
{ {
boolean draw_background = bg != color; bool draw_background = bg != color;
if ((x >= WIDTH) || // Clip right if ((x >= WIDTH) || // Clip right
(y >= HEIGHT) || // Clip bottom (y >= HEIGHT) || // Clip bottom
@ -861,7 +861,7 @@ void Arduboy2::setTextSize(uint8_t s)
textSize = max(1, s); textSize = max(1, s);
} }
void Arduboy2::setTextWrap(boolean w) void Arduboy2::setTextWrap(bool w)
{ {
textWrap = w; textWrap = w;
} }

View File

@ -50,13 +50,13 @@ public:
/** /**
* if (pressed(LEFT_BUTTON + A_BUTTON)) * if (pressed(LEFT_BUTTON + A_BUTTON))
*/ */
boolean pressed(uint8_t buttons); bool pressed(uint8_t buttons);
/// Returns true if the button mask passed in not pressed. /// Returns true if the button mask passed in not pressed.
/** /**
* if (notPressed(LEFT_BUTTON)) * if (notPressed(LEFT_BUTTON))
*/ */
boolean notPressed(uint8_t buttons); bool notPressed(uint8_t buttons);
/// Initialize hardware, boot logo, boot utilities, etc. /// Initialize hardware, boot logo, boot utilities, etc.
/** /**
@ -209,7 +209,7 @@ public:
uint8_t lastFrameDurationMs; uint8_t lastFrameDurationMs;
/// useful for getting raw approximate voltage values /// useful for getting raw approximate voltage values
uint16_t rawADC(byte adc_bits); uint16_t rawADC(uint8_t adc_bits);
protected: protected:
// helper function for sound enable/disable system control // helper function for sound enable/disable system control
@ -258,7 +258,7 @@ public:
void setTextSize(uint8_t s); void setTextSize(uint8_t s);
/// Sets whether text will wrap at screen edges. /// Sets whether text will wrap at screen edges.
void setTextWrap(boolean w); void setTextWrap(bool w);
/// Clears the display and sets the cursor to 0, 0 /// Clears the display and sets the cursor to 0, 0
void clear(); void clear();
@ -269,7 +269,7 @@ protected:
uint8_t textColor; uint8_t textColor;
uint8_t textBackground; uint8_t textBackground;
uint8_t textSize; uint8_t textSize;
boolean textWrap; // If set, 'wrap' text at right edge of display bool textWrap; // If set, 'wrap' text at right edge of display
}; };
#endif #endif