Skip to content

Commit

Permalink
FTDI whitespace tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Jun 11, 2020
1 parent bbe8400 commit fe969ec
Show file tree
Hide file tree
Showing 19 changed files with 270 additions and 266 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,8 @@ bool UIFlashStorage::is_present = false;
if (verifyOk) {
SERIAL_ECHOLNPGM("DONE");
return SUCCESS;
} else {
}
else {
SERIAL_ECHOLNPGM("FAIL");
return VERIFY_ERROR;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -932,7 +932,8 @@ template <class T> bool CLCD::CommandFifo::_write_unaligned(T data, uint16_t len
if (command_read_ptr <= command_write_ptr) {
bytes_tail = 4096U - command_write_ptr;
bytes_head = command_read_ptr;
} else {
}
else {
bytes_tail = command_read_ptr - command_write_ptr;
bytes_head = 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ class CommandProcessor : public CLCD::CommandFifo {
y += (h - th) / 2;
w -= tracker ? th * 5.0 : th * 2;
h = th;
} else {
}
else {
x += (w - th) / 2;
y += tracker ? th * 2.5 : th;
w = th;
Expand Down Expand Up @@ -254,7 +255,8 @@ class CommandProcessor : public CLCD::CommandFifo {
if (is_tracking) {
if (FTDI::EventLoop::is_touch_held()) {
return CLCD::get_tracker(value);
} else {
}
else {
CLCD::CommandFifo::track(0, 0, 0, 0, 0);
CLCD::CommandFifo::execute();
is_tracking = false;
Expand Down Expand Up @@ -319,7 +321,8 @@ class CommandProcessor : public CLCD::CommandFifo {
if (is_utf8) {
width = get_utf8_text_width(text, font_size_t::from_romfont(font));
height = font_size_t::from_romfont(font).get_height();
} else
}
else
#endif
{
CLCD::FontMetrics fm(font);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@
* DLCache dlcache(UNIQUE_ID);
*
* if (dlcache.hasData()) {
* dlcache.append();
* dlcache.append();
* } else {
* // Add stuff to the DL
* dlcache.store();
* // Add stuff to the DL
* dlcache.store();
* }
*/
class DLCache {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,12 @@ namespace FTDI {
if (UIData::flags.bits.touch_start_sound) sound.play(press_sound);
}

if (lastScreen != current_screen.getScreen()) {
// In the case in which a touch event triggered a new screen to be
// drawn, we don't issue a touchEnd since it would be sent to the
// wrong screen.
UIData::flags.bits.ignore_unpress = true;
} else {
UIData::flags.bits.ignore_unpress = false;
}
} else {
// In the case in which a touch event triggered a new screen to be
// drawn, we don't issue a touchEnd since it would be sent to the
// wrong screen.
UIData::flags.bits.ignore_unpress = (lastScreen != current_screen.getScreen());
}
else {
touch_timer.start();
}
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,8 @@ class CachedScreen {

if (dlcache.has_data()) {
dlcache.append();
} else {
}
else {
#ifdef TOUCH_UI_USE_UTF8
load_utf8_bitmaps(cmd);
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ namespace FTDI {
if (ms == 0 && fx == SILENCE && nt == END_SONG) {
sequence = 0;
play(SILENCE, REST);
} else {
}
else {
wait = ms;
timer.start();
play(fx, nt);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ namespace FTDI {
cmd.cmd(BITMAP_HANDLE(handle));
cmd.cmd(CELL(cell));
cmd.cmd(VERTEX2F(x * 16, y * 16));
} else {
}
else {
cmd.cmd(VERTEX2II(x, y, handle, cell));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

#include "../ftdi_extended.h"

#if defined(FTDI_EXTENDED) && ENABLED(TOUCH_UI_USE_UTF8)
#if BOTH(FTDI_EXTENDED, TOUCH_UI_USE_UTF8)

namespace FTDI {
// Returns the height of a standard FTDI romfont
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

#include "../ftdi_extended.h"

#if defined(FTDI_EXTENDED) && ENABLED(TOUCH_UI_USE_UTF8)
#if BOTH(FTDI_EXTENDED, TOUCH_UI_USE_UTF8)

constexpr static uint8_t std_font = 31;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

#include "../ftdi_extended.h"

#if defined(FTDI_EXTENDED) && ENABLED(TOUCH_UI_USE_UTF8)
#if BOTH(FTDI_EXTENDED, TOUCH_UI_USE_UTF8)

using namespace FTDI;

Expand Down
Loading

0 comments on commit fe969ec

Please sign in to comment.