// *********************************************************************
// *                             Template                              *
// *                           IQRF TEMPLATE                           *
// *********************************************************************
// Demonstration how to use a standard and extended Flash memory for
// the user application.
//
// Intended for:
//   HW: - TR-7xG
//
//   OS: - v4.06G
//
// Description:
//   - Standard user memory contains 3 codepages and Extended user memory
//     contains 2 memory codepages. The CC5X compiler can not switch
//     between these codepages automatically. Therefore the code must
//     be devided by user according to the example below.
//
// ---------------------------------------------------------------------
// Online IQRF OS Reference Guide: http://www.iqrf.org/IQRF-OS-Reference-guide/
//
// Copyright (c) IQRF Tech s.r.o.
//
// File:    Template.c
// Version: v3.01                                   Revision: 05/08/2022
//
// Revision history:
//   v3.01: 05/08/2022  Demonstration how to use Flash memory codepages added.
//   v3.00: 10/06/2021  First release for TR-7xG.
//
// *********************************************************************
// Default IQRF include (modify the path according to your setup)
#include "IQRF.h"

// *********************************************************************
void _setLEDR(void);
void _stopLEDR(void);
void _setLEDG(void);
void _stopLEDG(void);

// *********************************************************************
void APPLICATION()              // Code in first page of standard Flash
{
    // Change the code according to your needs
    while(1)
    {
        _setLEDR();
        waitMS(150);
        _stopLEDR();
        waitMS(150);
        _setLEDG();
        waitMS(150);
        _stopLEDG();
        waitMS(150);
    }
}

#pragma origin __USER_FLASH_PAGE_8
void _setLEDR(void)             // Code in second page of standard Flash
{
    setLEDR();
}

#pragma origin __USER_FLASH_PAGE_9
void _stopLEDR(void)            // Code in third page of standard Flash
{
    stopLEDR();
} 

#pragma origin __EXTENDED_FLASH
void _setLEDG(void)             // Code in first page of extended Flash
{
    setLEDG();
}

#pragma origin __EXTENDED_FLASH_NEXT_PAGE
void _stopLEDG(void)            // Code in second page of extended Flash
{
    stopLEDG();
} 
// *********************************************************************
