Skip to content

Commit ada96cc

Browse files
committed
Merge branch 'clemensvonmolo-paint-colorchange-vibration' into develop
2 parents a17d8bd + 1404d01 commit ada96cc

3 files changed

Lines changed: 10 additions & 4 deletions

File tree

src/displayapp/DisplayApp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ void DisplayApp::LoadApp(Apps app, DisplayApp::FullRefreshDirections direction)
430430
currentScreen = std::make_unique<Screens::Twos>(this);
431431
break;
432432
case Apps::Paint:
433-
currentScreen = std::make_unique<Screens::InfiniPaint>(this, lvgl);
433+
currentScreen = std::make_unique<Screens::InfiniPaint>(this, lvgl, motorController);
434434
break;
435435
case Apps::Paddle:
436436
currentScreen = std::make_unique<Screens::Paddle>(this, lvgl);

src/displayapp/screens/InfiniPaint.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44

55
using namespace Pinetime::Applications::Screens;
66

7-
InfiniPaint::InfiniPaint(Pinetime::Applications::DisplayApp* app, Pinetime::Components::LittleVgl& lvgl) : Screen(app), lvgl {lvgl} {
7+
InfiniPaint::InfiniPaint(Pinetime::Applications::DisplayApp* app,
8+
Pinetime::Components::LittleVgl& lvgl,
9+
Pinetime::Controllers::MotorController& motor)
10+
: Screen(app), lvgl {lvgl}, motor {motor} {
811
std::fill(b, b + bufferSize, selectColor);
912
}
1013

@@ -15,6 +18,7 @@ InfiniPaint::~InfiniPaint() {
1518
bool InfiniPaint::OnTouchEvent(Pinetime::Applications::TouchEvents event) {
1619
switch (event) {
1720
case Pinetime::Applications::TouchEvents::LongTap:
21+
color = (color + 1) % 8;
1822
switch (color) {
1923
case 0:
2024
selectColor = LV_COLOR_MAGENTA;
@@ -47,7 +51,7 @@ bool InfiniPaint::OnTouchEvent(Pinetime::Applications::TouchEvents event) {
4751
}
4852

4953
std::fill(b, b + bufferSize, selectColor);
50-
color++;
54+
motor.RunForDuration(35);
5155
return true;
5256
default:
5357
return true;

src/displayapp/screens/InfiniPaint.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include <cstdint>
55
#include <algorithm> // std::fill
66
#include "displayapp/screens/Screen.h"
7+
#include "components/motor/MotorController.h"
78

89
namespace Pinetime {
910
namespace Components {
@@ -14,7 +15,7 @@ namespace Pinetime {
1415

1516
class InfiniPaint : public Screen {
1617
public:
17-
InfiniPaint(DisplayApp* app, Pinetime::Components::LittleVgl& lvgl);
18+
InfiniPaint(DisplayApp* app, Pinetime::Components::LittleVgl& lvgl, Controllers::MotorController& motor);
1819

1920
~InfiniPaint() override;
2021

@@ -24,6 +25,7 @@ namespace Pinetime {
2425

2526
private:
2627
Pinetime::Components::LittleVgl& lvgl;
28+
Controllers::MotorController& motor;
2729
static constexpr uint16_t width = 10;
2830
static constexpr uint16_t height = 10;
2931
static constexpr uint16_t bufferSize = width * height;

0 commit comments

Comments
 (0)