MMDVM/FMTimer.h

53 lines
1.2 KiB
C
Raw Permalink Normal View History

2020-04-15 16:24:01 +02:00
/*
2020-04-15 18:18:01 +02:00
* Copyright (C) 2009,2010,2015,2020 by Jonathan Naylor G4KLX
2020-04-15 16:24:01 +02:00
*
* 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 of the License, 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; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "Config.h"
#if defined(MODE_FM)
2020-04-15 16:24:01 +02:00
#if !defined(FMTimer_H)
#define FMTimer_H
class CFMTimer {
public:
CFMTimer();
2020-04-15 18:18:01 +02:00
void setTimeout(uint16_t secs, uint32_t msecs);
2020-04-15 17:31:49 +02:00
2020-04-15 18:18:01 +02:00
uint32_t getTimeout() const;
2020-04-15 16:24:01 +02:00
void start();
void stop();
2020-04-15 18:18:01 +02:00
void clock(uint8_t length);
2020-04-15 16:24:01 +02:00
bool isRunning() const;
bool hasExpired() const;
private:
2020-04-15 18:18:01 +02:00
uint32_t m_timeout;
uint32_t m_timer;
2020-04-15 16:24:01 +02:00
};
#endif
#endif