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
}
uint16_t Arduboy2Base::rawADC(byte adc_bits)
uint16_t Arduboy2Base::rawADC(uint8_t adc_bits)
{
ADMUX = adc_bits;
// 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)
{
// bresenham's algorithm - thx wikpedia
boolean steep = abs(y1 - y0) > abs(x1 - x0);
bool steep = abs(y1 - y0) > abs(x1 - x0);
if (steep) {
swap(x0, y0);
swap(x1, y1);
@ -733,12 +733,12 @@ unsigned char* Arduboy2Base::getBuffer()
return sBuffer;
}
boolean Arduboy2Base::pressed(uint8_t buttons)
bool Arduboy2Base::pressed(uint8_t buttons)
{
return (buttonsState() & buttons) == buttons;
}
boolean Arduboy2Base::notPressed(uint8_t buttons)
bool Arduboy2Base::notPressed(uint8_t buttons)
{
return (buttonsState() & buttons) == 0;
}
@ -792,7 +792,7 @@ size_t Arduboy2::write(uint8_t c)
void Arduboy2::drawChar
(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
(y >= HEIGHT) || // Clip bottom
@ -861,7 +861,7 @@ void Arduboy2::setTextSize(uint8_t s)
textSize = max(1, s);
}
void Arduboy2::setTextWrap(boolean w)
void Arduboy2::setTextWrap(bool w)
{
textWrap = w;
}

View File

@ -50,13 +50,13 @@ public:
/**
* 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.
/**
* if (notPressed(LEFT_BUTTON))
*/
boolean notPressed(uint8_t buttons);
bool notPressed(uint8_t buttons);
/// Initialize hardware, boot logo, boot utilities, etc.
/**
@ -209,7 +209,7 @@ public:
uint8_t lastFrameDurationMs;
/// useful for getting raw approximate voltage values
uint16_t rawADC(byte adc_bits);
uint16_t rawADC(uint8_t adc_bits);
protected:
// helper function for sound enable/disable system control
@ -258,7 +258,7 @@ public:
void setTextSize(uint8_t s);
/// 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
void clear();
@ -269,7 +269,7 @@ protected:
uint8_t textColor;
uint8_t textBackground;
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