Compare commits
No commits in common. "master" and "1.0.0" have entirely different histories.
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -1,3 +0,0 @@
|
||||
[submodule "XFTGenerator"]
|
||||
path = XFTGenerator
|
||||
url = git@git.kb28.ch:HEL/XFTGenerator.git
|
8
.idea/.gitignore
vendored
Normal file
8
.idea/.gitignore
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
57
README.md
57
README.md
@ -1,57 +0,0 @@
|
||||
# XFT
|
||||
eXecutive Framework Template (XFT) is a template for project with femto XF.
|
||||
|
||||
Femto XF is an eXecutive Framework for embedded systems developed
|
||||
in the University of Applied Sciences Western Switzerland (HES-SO Valais/Wallis)
|
||||
by Pierre-André Mudry, Pascal Sartoretti and Medar Rieder.
|
||||
|
||||
This template is specifically designed for a PIC18F board. It's template for work with state machines.
|
||||
It used the model of the 5 layers for the packaging and double switch pattern for the state machine.
|
||||
|
||||
## Layers
|
||||
### App
|
||||
Here is the place for the application code.
|
||||
The application code is the code that is specific to the application and that is not reusable on another application.
|
||||
Here you can find the factory and obviously the main.
|
||||
|
||||
### Board
|
||||
Here is the place for the board specific code.
|
||||
The board code is the code that is not reusable on another board.
|
||||
|
||||
Here you can find in bonus a class for the LED and a class for the button for a PIC18F board.
|
||||
|
||||
### MCC Generated Files
|
||||
Here is the files generated by the MPLAB Code Configurator (MCC).
|
||||
You maybe have to regenerate them if you change the configuration of the board.
|
||||
|
||||
### Middleware
|
||||
Here is the place for the middleware code.
|
||||
The middleware code is the code that is not specific to the board and that is reusable on another board.
|
||||
Here you can find in bonus a class for a blinker and a class for a click handler.
|
||||
|
||||
### XF
|
||||
Here is the femto XF framework. No modification is needed.
|
||||
|
||||
## State machines
|
||||
### Generator
|
||||
You can generate a class for state machine with the following command:
|
||||
```bash
|
||||
python3 ./XFTGenerator/XFTGenerator.py
|
||||
```
|
||||
You can find the generated class in the folder `XFTGenerator/out/`.
|
||||
For more details about generator, see the README.md in the folder `XFTGenerator/`.
|
||||
|
||||
### How it works
|
||||
The architecture is based around the method `processEvent()`.
|
||||
This method is called by the XF when an event is received.
|
||||
|
||||
The method `processEvent()` is a switch on the current state.
|
||||
The first switch is switched on the actual state. The second switch is switched on event on exit and a third switch is switched on event on entry.
|
||||
|
||||
For each entry on an event you have a callback method than you can define in the class with the FILENAME_onState() method.
|
||||
|
||||
For each variables you have a setter.
|
||||
|
||||
For each event you have an emitter method that you can call in the class with the FILENAME_emitEvent() method.
|
||||
|
||||
Look the comments of .h file for more details.
|
@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @author Rémi Heredero
|
||||
* @version. 1.0.0
|
||||
* @date July 2023
|
||||
* @author R<EFBFBD>mi Heredero (remi@heredero.ch)
|
||||
* @version. 0.0.6
|
||||
* @date 2023-06-15
|
||||
*/
|
||||
#include "factory.h"
|
||||
|
||||
@ -62,6 +62,23 @@ CLICK_HANDLER* ch3() {
|
||||
return &theFactory.ch3_;
|
||||
}
|
||||
|
||||
BLINKER* blL() {
|
||||
return &theFactory.blL_;
|
||||
}
|
||||
BLINKER* blR() {
|
||||
return &theFactory.blR_;
|
||||
}
|
||||
BLINKER* blB() {
|
||||
return &theFactory.blB_;
|
||||
}
|
||||
BLINKER* blT() {
|
||||
return &theFactory.blT_;
|
||||
}
|
||||
|
||||
APP* app() {
|
||||
return &theFactory.app_;
|
||||
}
|
||||
|
||||
//initialize all objects
|
||||
void Factory_init() {
|
||||
LED_init(l1(), 1);
|
||||
|
@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @author Rémi Heredero
|
||||
* @version. 1.0.0
|
||||
* @date July 2023
|
||||
* @author R<EFBFBD>mi Heredero (remi@heredero.ch)
|
||||
* @version. 0.0.6
|
||||
* @date 2023-06-15
|
||||
*/
|
||||
|
||||
#ifndef FACTORY_H
|
||||
|
@ -27,5 +27,6 @@ void main(void)
|
||||
|
||||
while (1) {
|
||||
XF_executeOnce();
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user