Remove MotorController, use nrf_gpio Motor pin, apptimer repeat (#34)

Remove the custom MotorController class and use the upstream
MotorController instead.

To enable this move add custom code in nrf_gpio to handle the Motor pin
instead of the custom motor_is_running member variable.

Also implement the repeating app_timer type used in the upstream
MotorController.
This commit is contained in:
NeroBurner
2022-06-05 22:03:53 +02:00
committed by GitHub
parent f64e1aab80
commit ce22ba29c9
7 changed files with 49 additions and 108 deletions

View File

@@ -51,6 +51,7 @@
#include "displayapp/LittleVgl.h"
#include <nrfx_gpiote.h>
#include <hal/nrf_gpio.h>
#include <iostream>
#include <typeinfo>
@@ -402,19 +403,11 @@ public:
}
SDL_SetRenderDrawColor(renderer, 0, 0, 0, 0);
SDL_RenderClear(renderer);
{ // motorController.is_ringing
constexpr const int center_x = 15;
constexpr const int center_y = 15;
if (motorController.is_ringing) {
draw_circle_red(center_x, center_y, 15);
} else {
draw_circle_grey(center_x, center_y, 15);
}
}
{ // motorController.motor_is_running
constexpr const int center_x = 45;
constexpr const int center_y = 15;
if (motorController.motor_is_running) {
bool motor_is_running = nrf_gpio_pin_read(Pinetime::PinMap::Motor);
if (motor_is_running) {
draw_circle_red(center_x, center_y, 15);
} else {
draw_circle_grey(center_x, center_y, 15);