-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from antoinealb/hardware_abstraction
Started working on a HAL.
- Loading branch information
Showing
4 changed files
with
39 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#ifndef _PLATFORM_H_ | ||
#define _PLATFORM_H_ | ||
|
||
#ifdef COMPILE_ON_ROBOT | ||
#include <platform/platform_nios2.h> | ||
#else | ||
#include <platform/platform_host.h> | ||
#endif | ||
|
||
/** @brief Resets the boards. */ | ||
void reset(void); | ||
|
||
/** @brief Called after a non recoverable error. */ | ||
void panic(void); | ||
|
||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#ifndef _PLATFORM_HOST_H | ||
#define _PLATFORM_HOST_H | ||
|
||
/** Reimplementation de IORD du NIOS2 pour compiler sur le PC */ | ||
#define IORD(adress, offset) (*((int32_t *)adress+offset)) | ||
|
||
/** Reimplementation de IOWR du NIOS2 pour compiler sur le PC */ | ||
#define IOWR(adress, offset, data) (*((int32_t *)adress+offset) = data) | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#ifndef _PLATFORM_NIOS2_H_ | ||
#define _PLATFORM_NIOS2_H_ | ||
|
||
#include "os_cpu.h" | ||
#include "os_cfg.h" | ||
#include "ucos_ii.h" | ||
#include <system.h> | ||
#include <io.h> | ||
#include <sys/alt_irq.h> | ||
#include <aversive/error.h> | ||
|
||
#endif |