⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 watchdog.h

📁 good luck to everyone!
💻 H
字号:
/*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2008. All Rights Reserved.							  */
/* Open Source Software - may be modified and shared by FRC teams. The code   */
/* must be accompanied by the FIRST BSD license file in $(WIND_BASE)/WPILib.  */
/*----------------------------------------------------------------------------*/

#ifndef WATCHDOG_H
#define WATCHDOG_H

#include "ChipObject.h"
#include "SensorBase.h"
#include "Base.h"

/**
 * Watchdog timer class.
 * The watchdog timer is designed to keep the robots safe. The idea is that the robot program must
 * constantly "feed" the watchdog otherwise it will shut down all the motor outputs. That way if a
 * program breaks, rather than having the robot continue to operate at the last known speed, the
 * motors will be shut down.
 * 
 * This is serious business.  Don't just disable the watchdog.  You can't afford it!
 * 
 * http://thedailywtf.com/Articles/_0x2f__0x2f_TODO_0x3a__Uncomment_Later.aspx
 */
class Watchdog : public SensorBase
{
public:
	static const double kDefaultWatchdogExpiration = 0.5;

	Watchdog();
	virtual ~Watchdog();
	bool Feed();
	void Kill();
	double GetTimer();
	double GetExpiration();
	void SetExpiration(double expiration);
	bool GetEnabled();
	void SetEnabled(bool enabled);
	bool IsAlive();
	bool IsSystemActive();

private:
	tWatchdog *m_fpgaWatchDog;
	DISALLOW_COPY_AND_ASSIGN(Watchdog);
};

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -