//--------------------------------------------------------------------------- #include #pragma hdrstop #include "Unit1.h" #include "PACSDK.h" //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma resource "*.dfm" TForm1 *Form1; const int WD_TYPE = PAC_WDT_OS; // XPAC_WDT_OS changed to pac_wdt_os const unsigned int WatchDogTime = 10; unsigned int SecondsLeft = WatchDogTime; //--------------------------------------------------------------------------- __fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner) { Timer1->Interval = 1000; } //--------------------------------------------------------------------------- void __fastcall TForm1::Button1Click(TObject *Sender) { pac_EnableWatchDog(WD_TYPE, WatchDogTime); SecondsLeft = WatchDogTime; Timer1->Enabled = true; } //--------------------------------------------------------------------------- void __fastcall TForm1::Button2Click(TObject *Sender) { pac_DisableWatchDog(WD_TYPE); Timer1->Enabled = false; Label1->Caption = "X"; } //--------------------------------------------------------------------------- void __fastcall TForm1::Button3Click(TObject *Sender) { pac_RefreshWatchDog(WD_TYPE); SecondsLeft = WatchDogTime; } //--------------------------------------------------------------------------- void __fastcall TForm1::Timer1Timer(TObject *Sender) { Label1->Caption = IntToStr(SecondsLeft); SecondsLeft--; } //---------------------------------------------------------------------------