mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-01-27 14:57:12 -05:00
Add Signal for per-second tick callbacks.
This commit is contained in:
parent
7430e31578
commit
8188b44439
@ -181,6 +181,7 @@ CPPSRC = main.cpp \
|
|||||||
../common/ert_packet.cpp \
|
../common/ert_packet.cpp \
|
||||||
capture_app.cpp \
|
capture_app.cpp \
|
||||||
sd_card.cpp \
|
sd_card.cpp \
|
||||||
|
time.cpp \
|
||||||
file.cpp \
|
file.cpp \
|
||||||
log_file.cpp \
|
log_file.cpp \
|
||||||
png_writer.cpp \
|
png_writer.cpp \
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
#include "portapack.hpp"
|
#include "portapack.hpp"
|
||||||
|
|
||||||
#include "sd_card.hpp"
|
#include "sd_card.hpp"
|
||||||
|
#include "time.hpp"
|
||||||
|
|
||||||
#include "message.hpp"
|
#include "message.hpp"
|
||||||
#include "message_queue.hpp"
|
#include "message_queue.hpp"
|
||||||
@ -145,6 +146,8 @@ void EventDispatcher::handle_rtc_tick() {
|
|||||||
sd_card::poll_inserted();
|
sd_card::poll_inserted();
|
||||||
|
|
||||||
portapack::temperature_logger.second_tick();
|
portapack::temperature_logger.second_tick();
|
||||||
|
|
||||||
|
time::on_tick_second();
|
||||||
}
|
}
|
||||||
|
|
||||||
ui::Widget* EventDispatcher::touch_widget(ui::Widget* const w, ui::TouchEvent event) {
|
ui::Widget* EventDispatcher::touch_widget(ui::Widget* const w, ui::TouchEvent event) {
|
||||||
|
32
firmware/application/time.cpp
Normal file
32
firmware/application/time.cpp
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2015 Jared Boone, ShareBrained Technology, Inc.
|
||||||
|
*
|
||||||
|
* This file is part of PortaPack.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2, or (at your option)
|
||||||
|
* any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; see the file COPYING. If not, write to
|
||||||
|
* the Free Software Foundation, Inc., 51 Franklin Street,
|
||||||
|
* Boston, MA 02110-1301, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "time.hpp"
|
||||||
|
|
||||||
|
namespace time {
|
||||||
|
|
||||||
|
Signal<> signal_tick_second;
|
||||||
|
|
||||||
|
void on_tick_second() {
|
||||||
|
signal_tick_second.emit();
|
||||||
|
}
|
||||||
|
|
||||||
|
} /* namespace time */
|
35
firmware/application/time.hpp
Normal file
35
firmware/application/time.hpp
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2015 Jared Boone, ShareBrained Technology, Inc.
|
||||||
|
*
|
||||||
|
* This file is part of PortaPack.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2, or (at your option)
|
||||||
|
* any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; see the file COPYING. If not, write to
|
||||||
|
* the Free Software Foundation, Inc., 51 Franklin Street,
|
||||||
|
* Boston, MA 02110-1301, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __TIME_H__
|
||||||
|
#define __TIME_H__
|
||||||
|
|
||||||
|
#include "signal.hpp"
|
||||||
|
|
||||||
|
namespace time {
|
||||||
|
|
||||||
|
extern Signal<> signal_tick_second;
|
||||||
|
|
||||||
|
void on_tick_second();
|
||||||
|
|
||||||
|
} /* namespace time */
|
||||||
|
|
||||||
|
#endif/*__TIME_H__*/
|
Loading…
x
Reference in New Issue
Block a user