You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
2.7 KiB

//#############################################################################################################################################################################################################
#ifndef _INC_SYSTEM_H_
#define _INC_SYSTEM_H_
#ifdef __cplusplus
extern "C" {
#endif
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#include <inttypes.h>
#include "config.h"
#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/wdt.h>
#include <avr/eeprom.h>
#include <avr/pgmspace.h>
#include "MEMORY.h"
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#ifdef _LONG_ADDR_SPACE_
#define flash_read_byte(x,y) pgm_read_byte_far(x+y)
#define flash_read_word(x,y) pgm_read_word_far(x+y)
#define flash_read_dword(x,y) pgm_read_dword_far(x+y)
#else
#define flash_read_byte(x,y) pgm_read_byte(x+y)
#define flash_read_word(x,y) pgm_read_word(x+y)
#define flash_read_dword(x,y) pgm_read_dword(x+y)
#endif
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#define System_GetTimeInstance() System_GetSysTick()
uint32_t System_GetSysTick(void);
uint32_t HAL_GetTick(void);
uint32_t System_GetSysTickDifference(uint32_t TimeInstance);
void System_SWReboot(void);
#include <inttypes.h>
#include <avr/interrupt.h>
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
volatile extern uint32_t SystemSystickCounter;
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
void System_InitSysTick(void);
void System_SystickTimerStart(void);
void System_SystickTimerStop(void);
void readDeviceData(FLASH_DATABLOCK* data, FLASH_ADDR_T addr);
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#ifdef __cplusplus
}
#endif
#endif // #ifndef _INC_SYSTEM_H_
//#############################################################################################################################################################################################################