Skip to content

Commit

Permalink
Implement stop watch controller
Browse files Browse the repository at this point in the history
  • Loading branch information
Louis Pearson committed Nov 30, 2021
1 parent c75102f commit ec2b673
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,7 @@ list(APPEND SOURCE_FILES
components/motor/MotorController.cpp
components/settings/Settings.cpp
components/timer/TimerController.cpp
components/stopwatch/StopWatchController.cpp
components/alarm/AlarmController.cpp
components/fs/FS.cpp
drivers/Cst816s.cpp
Expand Down
4 changes: 2 additions & 2 deletions src/components/stopwatch/StopWatchController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

using namespace Pinetime::Controllers;

StopWatch::StopWatch() {}
// StopWatch::StopWatch() {}

// StopWatch::init() {}

Expand Down Expand Up @@ -37,7 +37,7 @@ bool StopWatch::isRunning() {
return currentState == StopWatchStates::Running;
}

bool StopWatch::isClear() {
bool StopWatch::isCleared() {
return currentState == StopWatchStates::Cleared;
}

Expand Down
3 changes: 2 additions & 1 deletion src/components/stopwatch/StopWatchController.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#pragma once

#include <cstdint>
#include "portmacro_cmsis.h"
// #include "portmacro_cmsis.h"
#include "FreeRTOS.h"

namespace Pinetime {
namespace System {
Expand Down
2 changes: 1 addition & 1 deletion src/displayapp/DisplayApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ DisplayApp::DisplayApp(Drivers::St7789& lcd,
Pinetime::Controllers::MotionController& motionController,
Pinetime::Controllers::TimerController& timerController,
Pinetime::Controllers::AlarmController& alarmController,
Pinetime::Controllers::StopWatchController& stopWatchController,
Pinetime::Controllers::StopWatch& stopWatchController,
Pinetime::Controllers::TouchHandler& touchHandler)
: lcd {lcd},
lvgl {lvgl},
Expand Down
4 changes: 2 additions & 2 deletions src/displayapp/DisplayApp.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ namespace Pinetime {
class HeartRateController;
class MotionController;
class TouchHandler;
class StopWatchController;
class StopWatch;
}

namespace System {
Expand Down Expand Up @@ -91,7 +91,7 @@ namespace Pinetime {
Pinetime::Controllers::TimerController& timerController;
Pinetime::Controllers::AlarmController& alarmController;
Pinetime::Controllers::TouchHandler& touchHandler;
Pinetime::Controllers::StopWatchController& stopWatchController;
Pinetime::Controllers::StopWatch& stopWatchController;

Pinetime::Controllers::FirmwareValidator validator;
Controllers::BrightnessController brightnessController;
Expand Down
4 changes: 4 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include "components/motor/MotorController.h"
#include "components/datetime/DateTimeController.h"
#include "components/heartrate/HeartRateController.h"
#include "components/stopwatch/StopWatchController.h"
#include "components/fs/FS.h"
#include "drivers/Spi.h"
#include "drivers/SpiMaster.h"
Expand Down Expand Up @@ -107,6 +108,7 @@ Pinetime::Drivers::WatchdogView watchdogView(watchdog);
Pinetime::Controllers::NotificationManager notificationManager;
Pinetime::Controllers::MotionController motionController;
Pinetime::Controllers::TimerController timerController;
Pinetime::Controllers::StopWatch stopWatchController;
Pinetime::Controllers::AlarmController alarmController {dateTimeController};
Pinetime::Controllers::TouchHandler touchHandler(touchPanel, lvgl);
Pinetime::Controllers::ButtonHandler buttonHandler;
Expand All @@ -129,6 +131,7 @@ Pinetime::Applications::DisplayApp displayApp(lcd,
motionController,
timerController,
alarmController,
stopWatchController,
touchHandler);

Pinetime::System::SystemTask systemTask(spi,
Expand All @@ -142,6 +145,7 @@ Pinetime::System::SystemTask systemTask(spi,
dateTimeController,
timerController,
alarmController,
stopWatchController,
watchdog,
notificationManager,
motorController,
Expand Down

0 comments on commit ec2b673

Please sign in to comment.