// *********************************************************************
// *                           RFPGM-TST                               *
// *                  Demo program to test RF upload                   *
// *********************************************************************
// An example for RF wireless upload.
// See IQRF OS User's guide, IQRF OS Reference guide and www.iqrf.org/rfpgm.
//
// Intended for:
//   HW: - TR-72G + DK-EVAL-04x development kit
//
//   OS: - v4.06G
//
// ---------------------------------------------------------------------
// Online IQRF OS Reference Guide: https://doc.iqrf.org/IQRF-OS-Reference-guide
//
// Copyright (c) IQRF Tech s.r.o.
//
// File:    E12-RFPGM-TST.c
// Version: v3.00                                   Revision: 11/06/2021
//
// Revision history:
//   v3.00: 11/06/2021  First release for TR-7xG.
//
// *********************************************************************
// Default IQRF include (modify the path according to your setup)
#include "IQRF.h"

// *********************************************************************
// First pressing the pushbutton for 0.7 s terminates RFPGM mode

void APPLICATION()
{
//  enableRFPGM();                      // Enable RFPGM during development
    disableRFPGM();                     // Disable RFPGM for final application
    
    waitDelay(100);

    while (1)
    {
        pulseLEDR();                    // Change LED color to demonstrate
//      pulseLEDG();                    //   successful RF upload.
        waitDelay(10);

        if (buttonPressed)              // Initiate RFPGM mode by the pushbutton
        {                      
            // All user peripheral interrupts must be disabled here (if used)
            
            runRFPGM();
        }
    }
}

// *********************************************************************

