Skip to content

Commit c6c0bd0

Browse files
committed
remove whitespace
1 parent 8818fa9 commit c6c0bd0

22 files changed

+633
-337
lines changed

src/modm/driver/display/ili9341.hpp

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/*
22
* Copyright (c) 2019, Mike Wolfram
3+
* Copyright (c) 2021, Thomas Sommer
34
*
45
* This file is part of the modm project.
56
*
@@ -15,7 +16,11 @@
1516
#include <modm/architecture/interface/register.hpp>
1617
#include <modm/platform/gpio/base.hpp>
1718
#include <modm/processing/resumable.hpp>
18-
#include <modm/ui/graphic.hpp>
19+
20+
#include <modm/ui/graphic/display.hpp>
21+
#include <modm/ui/graphic/buffer.hpp>
22+
#include <modm/ui/graphic/buffer_bool.hpp>
23+
// #include <modm/ui/graphic/painter_remote.hpp>
1924

2025
#include "ili9341_interface_parallel.hpp"
2126
#include "ili9341_interface_spi.hpp"
@@ -28,8 +33,9 @@ namespace modm
2833
/// @ingroup modm_driver_ili9341
2934
template<class Interface, class Reset, typename RB = Resolution<32, 32>>
3035
class Ili9341
31-
: public Interface, public Display<color::Rgb565<true>, Resolution<320, 240>>,
32-
public ShapePainter<Resolution<320, 240>, true>,
36+
: public Interface,
37+
// : public RemotePainter<Resolution<320, 240>, Interface>,
38+
public Display<color::Rgb565<true>, Resolution<320, 240>>,
3339
public FlashPainter<true>
3440
// TODO LocalPainter must be available so we can Paint directly on ili9341
3541
// class Ili9341 : public Interface, public Display<color::Rgb565<true>, 320, 240>, public LocalPainter<320, 240>
@@ -43,7 +49,8 @@ class Ili9341
4349

4450
public:
4551
template<typename... Args>
46-
Ili9341(Args &&...args) : Interface(std::forward<Args>(args)...),
52+
Ili9341(Args &&...args) :
53+
Interface(std::forward<Args>(args)...),
4754
Display<color::Rgb565<true>, Resolution<320, 240>>(color::html::White)
4855
{ Reset::setOutput(modm::Gpio::High); }
4956

@@ -119,7 +126,7 @@ class Ili9341
119126
modm::ResumableResult<void> setClipping(Point point);
120127
modm::ResumableResult<void> setClipping(Area area);
121128

122-
// TODO add final
129+
// TODO Add final as soon as RemotePainter is connected
123130
// Hardware accelerated drawing directly on the screen
124131
modm::ResumableResult<void> drawFast(Point point);
125132
modm::ResumableResult<void> drawFast(HLine hline);
@@ -133,8 +140,7 @@ class Ili9341
133140
uint16_t buff_cmd16[3];
134141
ili9341_register::MemoryAccessCtrl_t madCtrl;
135142

136-
// Parallel use in resumable function
137-
// No overlap permitted!
143+
// Parallel use in resumable function: don't overlap!
138144
struct {
139145
// Buffer for color conversion
140146
modm::Buffer<modm::color::Rgb565<true>, RB> bufferRgb565;

src/modm/driver/display/ili9341_interface_spi.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ template<class SpiMaster, class Cs, class Dc>
2828
class Ili9341InterfaceSpi : public ili9341_register, public modm::SpiDevice< SpiMaster >, protected modm::NestedResumable<4>
2929
{
3030
uint8_t read;
31-
public:
31+
protected:
3232
Ili9341InterfaceSpi()
3333
{
3434
this->attachConfigurationHandler([]() {

src/modm/driver/display/ili9341_register.hpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
/*
2+
* Copyright (c) 2019, Mike Wolfram
3+
* Copyright (c) 2021, Thomas Sommer
4+
*
5+
* This file is part of the modm project.
6+
*
7+
* This Source Code Form is subject to the terms of the Mozilla Public
8+
* License, v. 2.0. If a copy of the MPL was not distributed with this
9+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
10+
*/
11+
112
#pragma once
213

314
#include <modm/math/utils/bit_constants.hpp>
@@ -24,7 +35,8 @@ struct ili9341_register
2435
ContentAdaptiveBrightnessCtrl = 0x55,
2536
CabcMinimumBrightness = 0x5E,
2637
};
27-
protected:
38+
39+
// protected:
2840
enum class Command : uint8_t
2941
{
3042
Nop = 0x00,

src/modm/driver/display/ssd1306.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717
#include <modm/architecture/interface/i2c_device.hpp>
1818
#include <modm/architecture/utils.hpp>
1919
#include <modm/processing/timer.hpp>
20-
#include <modm/ui/graphic.hpp>
20+
21+
#include <modm/ui/graphic/display.hpp>
22+
#include <modm/ui/graphic/buffer_bool.hpp>
2123

2224
#include "ssd1306_register.hpp"
2325

src/modm/ui/graphic/buffer.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#ifndef MODM_BUFFER_HPP
1313
#define MODM_BUFFER_HPP
1414

15-
#include "painter_shape.hpp"
15+
#include "painter_local.hpp"
1616
#include "painter_text.hpp"
1717
#include "../color.hpp"
1818

@@ -25,7 +25,7 @@ namespace modm
2525
* Colored Graphic buffer
2626
*
2727
* @tparam C Pixelcolor
28-
* @tparam R Pixels Width and Height
28+
* @tparam R Resolution with Pixels horizontal and vertical
2929
*
3030
* @author Thomas Sommer
3131
* @ingroup modm_ui_graphic
@@ -34,7 +34,7 @@ namespace modm
3434
// May inherit on modm::Matrix<..> or provide a conversion constructor for modm::Matrix<..>
3535
template<typename C, typename R>
3636
requires C::isColor or std::is_same_v<C, bool>
37-
class Buffer : public ShapePainter<R, false>, public TextPainter<R>
37+
class Buffer : public LocalPainter<R>, public TextPainter<R>
3838
{
3939
public:
4040
C color = html::White;

src/modm/ui/graphic/buffer_bool.hpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,23 @@
1414

1515
#include <algorithm>
1616

17-
#include "painter_shape.hpp"
17+
#include "painter_local.hpp"
1818
#include "painter_text.hpp"
1919
namespace modm
2020
{
2121

2222
/**
2323
* Monochrome Graphic buffer
2424
*
25-
* @tparam R Pixels Width and Height
25+
* @tparam R Resolution with Pixels horizontal and vertical
2626
*
2727
* @author Thomas Sommer
2828
* @ingroup modm_ui_graphic
2929
*/
3030
template<typename R>
31-
class Buffer<bool, R> : public ShapePainter<R, false>, public TextPainter<R>
31+
class Buffer<bool, R> : public LocalPainter<R>, public TextPainter<R>
3232
{
33+
// Buffer stacks up to 8 pixels in one byte
3334
static constexpr size_t HB = (R::H + 7) / 8;
3435
public:
3536
bool color = true;

src/modm/ui/graphic/buffer_bool_impl.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ template<typename R>
230230
void
231231
modm::Buffer<bool, R>::drawFast(Point point)
232232
{
233-
// OPTIMIZE evaluate color in ShapePainter ?
233+
// OPTIMIZE Switch color in LocalPainter ?
234234
if (color)
235235
this->buffer[point.y / 8][point.x] |= (1 << point.y % 8);
236236
else
@@ -246,7 +246,7 @@ modm::Buffer<bool, R>::drawFast(HLine hline)
246246

247247
size_t x = hline.start.x;
248248

249-
// OPTIMIZE evaluate color in ShapePainter ?
249+
// OPTIMIZE Switch color in LocalPainter ?
250250
if(color)
251251
while (x < hline.end_x)
252252
buffer[yb][x++] |= byte;
@@ -262,7 +262,7 @@ modm::Buffer<bool, R>::drawFast(VLine vline)
262262
size_t yb = vline.start.y / 8;
263263
const size_t yb_max = vline.end_y / 8;
264264

265-
// OPTIMIZE evaluate color in ShapePainter ?
265+
// OPTIMIZE Switch color in LocalPainter ?
266266
if (color)
267267
{
268268
uint8_t byte = 0xFF << vline.start.y % 8; // Mask out top end
@@ -298,7 +298,7 @@ modm::Buffer<bool, R>::drawFast(Area area)
298298
const size_t yb_max = area.bottomRight.y / 8;
299299
size_t yb = area.topLeft.y / 8;
300300

301-
// OPTIMIZE evaluate color in ShapePainter
301+
// OPTIMIZE Switch color in LocalPainter
302302
if (color)
303303
{
304304
uint8_t byte = 0xFF << area.topLeft.y % 8; // Mask out top end

src/modm/ui/graphic/canvas.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ struct Resolution{
3434
/**
3535
* Baseclass for 2D Graphic Objects like Display and Buffer
3636
*
37-
* @tparam R Pixels Width and Height
37+
* @tparam R Resolution with Pixels horizontal and vertical
3838
*
3939
* @author Thomas Sommer
4040
* @ingroup modm_ui_graphic

src/modm/ui/graphic/painter.hpp

Lines changed: 0 additions & 185 deletions
This file was deleted.

0 commit comments

Comments
 (0)