Archived
Merge branch 'feature/EEPROM' into develop
This commit is contained in:
commit
38d7936da7
30 files changed
+18734
-218
No files matched your search
@@ -0,0 +1 @@
|
||||
.idea
|
||||
@@ -5,9 +5,10 @@
|
||||
* @file can_message.c
|
||||
*/
|
||||
|
||||
#include "../middleware/can_interface.h"
|
||||
#include "can_message.h"
|
||||
#include "car.h"
|
||||
#include "../app/factory/factory.h"
|
||||
#include "../middleware/can_interface.h"
|
||||
|
||||
typedef union {
|
||||
struct {
|
||||
@@ -23,36 +24,166 @@ typedef union {
|
||||
|
||||
void CM_processIncome(uint8_t idSender, uint8_t idMsg, uint32_t data){
|
||||
switch(idSender){
|
||||
case 0: // Broadcast / Debug
|
||||
|
||||
/*********************
|
||||
* BROADCAST / DEBUG *
|
||||
*********************/
|
||||
case 0:
|
||||
if(idMsg == 0x0) { // CONTROL_SETUP
|
||||
// steeringMode - - controlAliveTime
|
||||
BYTES_4 tmpData;
|
||||
tmpData.full.bytes = data;
|
||||
CAR_CST.CONTROL_STEERING_MODE = tmpData.separate.byte0;
|
||||
CAR_CST.CONTROL_ALIVE_TIME = tmpData.separate.byte3;
|
||||
MEM_write_1_byte(MEMADD_CONTROL_STEERING_MODE, CAR_CST.CONTROL_STEERING_MODE);
|
||||
MEM_write_1_byte(MEMADD_CONTROL_ALIVE_TIME, CAR_CST.CONTROL_ALIVE_TIME);
|
||||
WATCHDOG_setTime(WDcontroller(), CAR_CST.CONTROL_ALIVE_TIME);
|
||||
}
|
||||
|
||||
if(idMsg == 0x1) { // CONTROL_SPEED_FACTOR
|
||||
// valHH valH valL valLL
|
||||
|
||||
}
|
||||
|
||||
if(idMsg == 0x2) { // CONTROL_POWER_FACTOR
|
||||
// valHH valH valL valLL
|
||||
|
||||
}
|
||||
|
||||
if(idMsg == 0x3) { // CONTROL_STEERING_FACTOR
|
||||
// valHH valH valL valLL
|
||||
|
||||
}
|
||||
|
||||
if(idMsg == 0x4) { // CONTROL_SECURITY_PARAM
|
||||
// maxSpeedFw maxSpeedBw - -
|
||||
|
||||
}
|
||||
|
||||
if(idMsg == 0x5) { // CONTROL_SETUP_PARAM
|
||||
// displayAliveTime steeringAliveTime - -
|
||||
|
||||
}
|
||||
|
||||
if(idMsg == 0x6) { // CONTROL_SETUP_PARAM_JOY
|
||||
// joystickMode joystickParam1 joystickParam2 joystickAliveTime
|
||||
BYTES_4 tmpData;
|
||||
tmpData.full.bytes = data;
|
||||
CAR_CST.JOYSTICK_MODE = tmpData.separate.byte0;
|
||||
CAR_CST.JOYSTICK_PARAM1 = tmpData.separate.byte1;
|
||||
CAR_CST.JOYSTICK_PARAM2 = tmpData.separate.byte2;
|
||||
CAR_CST.JOYSTICK_ALIVE_TIME = tmpData.separate.byte3;
|
||||
MEM_write_1_byte(MEMADD_JOYSTICK_MODE, CAR_CST.JOYSTICK_MODE);
|
||||
MEM_write_1_byte(MEMADD_JOYSTICK_PARAM1, CAR_CST.JOYSTICK_PARAM1);
|
||||
MEM_write_1_byte(MEMADD_JOYSTICK_PARAM2, CAR_CST.JOYSTICK_PARAM2);
|
||||
MEM_write_1_byte(MEMADD_JOYSTICK_ALIVE_TIME, CAR_CST.JOYSTICK_ALIVE_TIME);
|
||||
|
||||
ALIVE_CHECKER_setAliveTime(ACjoy(), CAR_CST.JOYSTICK_ALIVE_TIME);
|
||||
CM_JOY_SETUP(NULL);
|
||||
|
||||
}
|
||||
|
||||
if(idMsg == 0x7) { // CONTROL_SETUP_PARAM_DRIVE
|
||||
// driveAliveTime driveSpeedTime driveStopTime -
|
||||
|
||||
}
|
||||
|
||||
if(idMsg == 0x8) { // CONTROL_SETUP_PARAM_BATTERY
|
||||
// batteryVoltTime batteryCurrentTime batteryEnergyTime batteryAliveTime
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 2: // Joystick
|
||||
|
||||
/************
|
||||
* JOYSTICK *
|
||||
************/
|
||||
case 2:
|
||||
if(idMsg == 0x1) { // JOY_MESURE
|
||||
// posX posY button -
|
||||
|
||||
}
|
||||
|
||||
if(idMsg == 0xF) { // JOY_ALIVE
|
||||
// - - - -
|
||||
ALIVE_CHECKER_ISALIVE(ACjoy());
|
||||
if(ACjoy()->state == STAC_DEAD){
|
||||
CAR_CST.JOYSTICK_MODE = MEM_read_1_byte(MEMADD_JOYSTICK_MODE);
|
||||
CAR_CST.JOYSTICK_PARAM1 = MEM_read_1_byte(MEMADD_JOYSTICK_PARAM1);
|
||||
CAR_CST.JOYSTICK_PARAM2 = MEM_read_1_byte(MEMADD_JOYSTICK_PARAM2);
|
||||
CAR_CST.JOYSTICK_ALIVE_TIME = MEM_read_1_byte(MEMADD_JOYSTICK_ALIVE_TIME);
|
||||
ALIVE_CHECKER_setAliveTime(ACjoy(), CAR_CST.JOYSTICK_ALIVE_TIME);
|
||||
ALIVE_CHECKER_emitBorn(ACjoy(), 0, 0);
|
||||
ALIVE_CHECKER_emitReady(ACjoy(), 100, 0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 3: // Display
|
||||
|
||||
/***********
|
||||
* DISPLAY *
|
||||
***********/
|
||||
case 3:
|
||||
if(idMsg == 0xF) { // DISPLAY_ALIVE
|
||||
// powerMode - - -
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
case 4: // Drive
|
||||
|
||||
/*********
|
||||
* DRIVE *
|
||||
*********/
|
||||
case 4:
|
||||
if(idMsg == 0x0) { // DRIVE_SPEED
|
||||
// speedHH speedH speedL speedLL
|
||||
|
||||
}
|
||||
|
||||
if(idMsg == 0xF) { // DRIVE_ALIVE
|
||||
// statusH statusL - -
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
case 5: // Steering
|
||||
|
||||
/************
|
||||
* STEERING *
|
||||
************/
|
||||
case 5:
|
||||
if(idMsg == 0x1) { // STEERING_GET_CENTER
|
||||
// valHH valH valL valLL
|
||||
|
||||
}
|
||||
|
||||
if(idMsg == 0x2) { // STEERING_GET_POSITION
|
||||
// valHH valH valL valLL
|
||||
|
||||
}
|
||||
|
||||
if(idMsg == 0xF) { // STEERING_ALIVE
|
||||
// statusH statusL - -
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
case 6: // Supply
|
||||
|
||||
/**********
|
||||
* SUPPLY *
|
||||
**********/
|
||||
case 6:
|
||||
if(idMsg == 0xF) { // BATTERY_ALIVE
|
||||
// - - - -
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
case 7: // Undefined
|
||||
|
||||
/*************
|
||||
* UNDEFINED *
|
||||
*************/
|
||||
case 7:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,9 @@
|
||||
#ifndef CAN_MESSAGE_H
|
||||
#define CAN_MESSAGE_H
|
||||
|
||||
#include <stdint.h> // usage of standard types
|
||||
#include <stdbool.h> // usage of boolean types
|
||||
#include "../mcc_generated_files/mcc.h"
|
||||
|
||||
/*
|
||||
S R M
|
||||
|
||||
@@ -34,12 +34,15 @@
|
||||
#define MEMADD_JOYSTICK_PARAM1 0x12
|
||||
#define MEMADD_JOYSTICK_PARAM2 0x13
|
||||
#define MEMADD_JOYSTICK_ALIVE_TIME 0x14
|
||||
#define MEMADD_DISPLAY_ALIVE_TIME 0x
|
||||
#define MEMADD_DRIVE_SPEED_TIME 0x
|
||||
#define MEMADD_DRIVE_STOP_TIME 0x
|
||||
#define MEMADD_DRIVE_ALIVE_TIME 0x
|
||||
#define MEMADD_STEERING_ALIVE_TIME 0x
|
||||
#define MEMADD_BATTERY_ALIVE_TIME 0x
|
||||
#define MEMADD_DISPLAY_ALIVE_TIME 0x15
|
||||
#define MEMADD_DRIVE_SPEED_TIME 0x16
|
||||
#define MEMADD_DRIVE_STOP_TIME 0x17
|
||||
#define MEMADD_DRIVE_ALIVE_TIME 0x18
|
||||
#define MEMADD_STEERING_ALIVE_TIME 0x19
|
||||
#define MEMADD_BATTERY_VOLT_TIME 0x1A
|
||||
#define MEMADD_BATTERY_CURRENT_TIME 0x1B
|
||||
#define MEMADD_BATTERY_ENERGY_TIME 0x1C
|
||||
#define MEMADD_BATTERY_ALIVE_TIME 0x1D
|
||||
|
||||
typedef struct {
|
||||
uint8_t CONTROL_STEERING_MODE;
|
||||
@@ -49,7 +52,6 @@ typedef struct {
|
||||
uint32_t CONTROL_STEERING_FACTOR;
|
||||
uint8_t CONTROL_MAX_SPEED_FW;
|
||||
uint8_t CONTROL_MAX_SPEED_BW;
|
||||
|
||||
uint8_t JOYSTICK_MODE;
|
||||
uint8_t JOYSTICK_PARAM1;
|
||||
uint8_t JOYSTICK_PARAM2;
|
||||
@@ -59,6 +61,9 @@ typedef struct {
|
||||
uint8_t DRIVE_STOP_TIME;
|
||||
uint8_t DRIVE_ALIVE_TIME;
|
||||
uint8_t STEERING_ALIVE_TIME;
|
||||
uint8_t BATTERY_VOLT_TIME;
|
||||
uint8_t BATTERY_CURRENT_TIME;
|
||||
uint8_t BATTERY_ENERGY_TIME;
|
||||
uint8_t BATTERY_ALIVE_TIME;
|
||||
} CAR_CST_TYPE;
|
||||
CAR_CST_TYPE CAR_CST;
|
||||
|
||||
@@ -64,17 +64,12 @@ void Factory_init() {
|
||||
LED_off(l1());
|
||||
|
||||
// TODO init EPROM interface
|
||||
MEM_init();
|
||||
|
||||
// TODO init watchdog with EPROM CST
|
||||
WATCHDOG_init(WDcontroller());
|
||||
CAR_CST.CONTROL_ALIVE_TIME = 100;
|
||||
WATCHDOG_setTime(WDcontroller(), CAR_CST.CONTROL_ALIVE_TIME);
|
||||
|
||||
// TODO init ALIVE CHECKER with EPROM CST
|
||||
CAR_CST.JOYSTICK_MODE = 0;
|
||||
CAR_CST.JOYSTICK_PARAM1 = 100;
|
||||
CAR_CST.JOYSTICK_PARAM2 = 1;
|
||||
CAR_CST.JOYSTICK_ALIVE_TIME = 10;
|
||||
ALIVE_CHECKER_init(ACjoy());
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "../../middleware/alive_checker.h"
|
||||
#include "../../middleware/can_interface.h"
|
||||
#include "../../middleware/watchdog.h"
|
||||
#include "../../middleware/eeprom.h"
|
||||
|
||||
|
||||
typedef struct {
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
This header file provides implementations for driver APIs for all modules selected in the GUI.
|
||||
Generation Information :
|
||||
Product Revision : PIC10 / PIC12 / PIC16 / PIC18 MCUs - 1.81.8
|
||||
Device : PIC18F25K83
|
||||
Device : PIC18F26K83
|
||||
Driver Version : 2.00
|
||||
The generated drivers are tested against the following:
|
||||
Compiler : XC8 2.36 and above or later
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
This header file provides implementations for driver APIs for all modules selected in the GUI.
|
||||
Generation Information :
|
||||
Product Revision : PIC10 / PIC12 / PIC16 / PIC18 MCUs - 1.81.8
|
||||
Device : PIC18F25K83
|
||||
Device : PIC18F26K83
|
||||
Driver Version : 2.00
|
||||
The generated drivers are tested against the following:
|
||||
Compiler : XC8 2.36 and above or later
|
||||
|
||||
@@ -130,17 +130,21 @@ void ECAN_Initialize(void)
|
||||
/*
|
||||
* ENABLE FILTERS
|
||||
*
|
||||
* Filter 0 set on mask 0
|
||||
* Filter 1 set on mask 0
|
||||
* Filter 2 set on mask 1
|
||||
* RXF7EN RXF6EN RXF5EN RXF4EN RXF3EN RXF2EN RXF1EN RXF0EN
|
||||
* 0b 00000111
|
||||
*/
|
||||
RXFCON0 = 0x07;
|
||||
|
||||
|
||||
/**
|
||||
Assign Filters to Masks
|
||||
*/
|
||||
// Filter 0 & 1 assigned to mask 0 and filter 2 assigned to mask 1
|
||||
/*
|
||||
* Assign Filters to Masks
|
||||
*
|
||||
* Filter 0 set on mask 0
|
||||
* Filter 1 set on mask 0
|
||||
* Filter 2 set on mask 1
|
||||
* 0b F3 F2 F1 F0
|
||||
* 0b 00 01 00 00
|
||||
*/
|
||||
MSEL0 = 0x10;
|
||||
|
||||
/**
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
all modules selected in the GUI.
|
||||
Generation Information :
|
||||
Product Revision : PIC10 / PIC12 / PIC16 / PIC18 MCUs - 1.81.8
|
||||
Device : PIC18F25K83
|
||||
Device : PIC18F26K83
|
||||
Driver Version : 2.04
|
||||
The generated drivers are tested against the following:
|
||||
Compiler : XC8 2.36 and above or later
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
all modules selected in the GUI.
|
||||
Generation Information :
|
||||
Product Revision : PIC10 / PIC12 / PIC16 / PIC18 MCUs - 1.81.8
|
||||
Device : PIC18F25K83
|
||||
Device : PIC18F26K83
|
||||
Driver Version : 2.03
|
||||
The generated drivers are tested against the following:
|
||||
Compiler : XC8 2.36 and above or later
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
This header file provides implementations for driver APIs for all modules selected in the GUI.
|
||||
Generation Information :
|
||||
Product Revision : PIC10 / PIC12 / PIC16 / PIC18 MCUs - 1.81.8
|
||||
Device : PIC18F25K83
|
||||
Device : PIC18F26K83
|
||||
Driver Version : 2.00
|
||||
The generated drivers are tested against the following:
|
||||
Compiler : XC8 2.36 and above or later
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
This header file provides implementations for driver APIs for all modules selected in the GUI.
|
||||
Generation Information :
|
||||
Product Revision : PIC10 / PIC12 / PIC16 / PIC18 MCUs - 1.81.8
|
||||
Device : PIC18F25K83
|
||||
Device : PIC18F26K83
|
||||
Driver Version : 2.00
|
||||
The generated drivers are tested against the following:
|
||||
Compiler : XC8 2.36 and above or later
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
This file provides implementations of driver APIs for MEMORY.
|
||||
Generation Information :
|
||||
Product Revision : PIC10 / PIC12 / PIC16 / PIC18 MCUs - 1.81.8
|
||||
Device : PIC18F25K83
|
||||
Device : PIC18F26K83
|
||||
Driver Version : 2.1.3
|
||||
The generated drivers are tested against the following:
|
||||
Compiler : XC8 2.36 and above
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
This header file provides APIs for driver for MEMORY.
|
||||
Generation Information :
|
||||
Product Revision : PIC10 / PIC12 / PIC16 / PIC18 MCUs - 1.81.8
|
||||
Device : PIC18F25K83
|
||||
Device : PIC18F26K83
|
||||
Driver Version : 2.1.3
|
||||
The generated drivers are tested against the following:
|
||||
Compiler : XC8 2.36 and above
|
||||
@@ -64,9 +64,9 @@
|
||||
Section: Macro Declarations
|
||||
*/
|
||||
|
||||
#define WRITE_FLASH_BLOCKSIZE 64
|
||||
#define ERASE_FLASH_BLOCKSIZE 64
|
||||
#define END_FLASH 0x008000
|
||||
#define WRITE_FLASH_BLOCKSIZE 128
|
||||
#define ERASE_FLASH_BLOCKSIZE 128
|
||||
#define END_FLASH 0x010000
|
||||
|
||||
/**
|
||||
Section: Flash Module APIs
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
This header file provides implementations for pin APIs for all pins selected in the GUI.
|
||||
Generation Information :
|
||||
Product Revision : PIC10 / PIC12 / PIC16 / PIC18 MCUs - 1.81.8
|
||||
Device : PIC18F25K83
|
||||
Device : PIC18F26K83
|
||||
Driver Version : 2.11
|
||||
The generated drivers are tested against the following:
|
||||
Compiler : XC8 2.36 and above
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
This header file provides APIs for driver for .
|
||||
Generation Information :
|
||||
Product Revision : PIC10 / PIC12 / PIC16 / PIC18 MCUs - 1.81.8
|
||||
Device : PIC18F25K83
|
||||
Device : PIC18F26K83
|
||||
Driver Version : 2.11
|
||||
The generated drivers are tested against the following:
|
||||
Compiler : XC8 2.36 and above
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
This source file provides APIs for TMR0.
|
||||
Generation Information :
|
||||
Product Revision : PIC10 / PIC12 / PIC16 / PIC18 MCUs - 1.81.8
|
||||
Device : PIC18F25K83
|
||||
Device : PIC18F26K83
|
||||
Driver Version : 3.10
|
||||
The generated drivers are tested against the following:
|
||||
Compiler : XC8 2.36 and above
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
This header file provides APIs for TMR0.
|
||||
Generation Information :
|
||||
Product Revision : PIC10 / PIC12 / PIC16 / PIC18 MCUs - 1.81.8
|
||||
Device : PIC18F25K83
|
||||
Device : PIC18F26K83
|
||||
Driver Version : 3.10
|
||||
The generated drivers are tested against the following:
|
||||
Compiler : XC8 2.36 and above
|
||||
|
||||
@@ -146,13 +146,13 @@ void CAN_newMsg() {
|
||||
CAN_receive(&canMsg);
|
||||
data = canMsg.frame.id;
|
||||
data = data<<12;
|
||||
data = data | canMsg.frame.data0;
|
||||
data = data<<8;
|
||||
data = data | canMsg.frame.data1;
|
||||
data = data | canMsg.frame.data3;
|
||||
data = data<<8;
|
||||
data = data | canMsg.frame.data2;
|
||||
data = data<<8;
|
||||
data = data | canMsg.frame.data3;
|
||||
data = data | canMsg.frame.data1;
|
||||
data = data<<8;
|
||||
data = data | canMsg.frame.data0;
|
||||
POST(&CAN_myself, &CAN_processEvent, evCAnewMsg, 0, data);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,135 @@
|
||||
/**
|
||||
* @author R�mi Heredero
|
||||
* @version 1.0.0
|
||||
* @date August 2023
|
||||
* @file eeprom_interface.h
|
||||
*/
|
||||
|
||||
#include "eeprom.h"
|
||||
#include "../app/car.h"
|
||||
|
||||
typedef union {
|
||||
struct {
|
||||
uint8_t byte0;
|
||||
uint8_t byte1;
|
||||
uint8_t byte2;
|
||||
uint8_t byte3;
|
||||
} separate;
|
||||
uint32_t full;
|
||||
uint8_t array[4];
|
||||
} BYTES_4;
|
||||
|
||||
void MEM_init(){
|
||||
uint8_t check = MEM_read_1_byte(0x0);
|
||||
if(check != 0x42){
|
||||
CAR_CST.CONTROL_STEERING_MODE = 0;
|
||||
CAR_CST.CONTROL_ALIVE_TIME = 50;
|
||||
CAR_CST.CONTROL_SPEED_FACTOR = 0;
|
||||
CAR_CST.CONTROL_POWER_FACTOR = 0;
|
||||
CAR_CST.CONTROL_STEERING_FACTOR = 0;
|
||||
CAR_CST.CONTROL_MAX_SPEED_FW = 0;
|
||||
CAR_CST.CONTROL_MAX_SPEED_BW = 0;
|
||||
|
||||
CAR_CST.JOYSTICK_MODE = 0;
|
||||
CAR_CST.JOYSTICK_PARAM1 = 100;
|
||||
CAR_CST.JOYSTICK_PARAM2 = 1;
|
||||
CAR_CST.JOYSTICK_ALIVE_TIME = 10;
|
||||
|
||||
CAR_CST.DISPLAY_ALIVE_TIME = 50;
|
||||
|
||||
CAR_CST.DRIVE_SPEED_TIME = 0;
|
||||
CAR_CST.DRIVE_STOP_TIME = 0;
|
||||
CAR_CST.DRIVE_ALIVE_TIME = 10;
|
||||
|
||||
CAR_CST.STEERING_ALIVE_TIME = 100;
|
||||
|
||||
CAR_CST.BATTERY_VOLT_TIME = 50;
|
||||
CAR_CST.BATTERY_CURRENT_TIME = 50;
|
||||
CAR_CST.BATTERY_ENERGY_TIME = 50;
|
||||
CAR_CST.BATTERY_ALIVE_TIME = 50;
|
||||
|
||||
MEM_write_1_byte(MEMADD_CONTROL_STEERING_MODE, CAR_CST.CONTROL_STEERING_MODE);
|
||||
MEM_write_1_byte(MEMADD_CONTROL_ALIVE_TIME, CAR_CST.CONTROL_ALIVE_TIME);
|
||||
MEM_write_4_byte(MEMADD_CONTROL_SPEED_FACTOR, CAR_CST.CONTROL_SPEED_FACTOR);
|
||||
MEM_write_4_byte(MEMADD_CONTROL_POWER_FACTOR, CAR_CST.CONTROL_POWER_FACTOR);
|
||||
MEM_write_4_byte(MEMADD_CONTROL_STEERING_FACTOR, CAR_CST.CONTROL_STEERING_FACTOR);
|
||||
MEM_write_1_byte(MEMADD_CONTROL_MAX_SPEED_FW, CAR_CST.CONTROL_MAX_SPEED_FW);
|
||||
MEM_write_1_byte(MEMADD_CONTROL_MAX_SPEED_BW, CAR_CST.CONTROL_MAX_SPEED_BW);
|
||||
|
||||
MEM_write_1_byte(MEMADD_JOYSTICK_MODE, CAR_CST.JOYSTICK_MODE);
|
||||
MEM_write_1_byte(MEMADD_JOYSTICK_PARAM1, CAR_CST.JOYSTICK_PARAM1);
|
||||
MEM_write_1_byte(MEMADD_JOYSTICK_PARAM2, CAR_CST.JOYSTICK_PARAM2);
|
||||
MEM_write_1_byte(MEMADD_JOYSTICK_ALIVE_TIME, CAR_CST.JOYSTICK_ALIVE_TIME);
|
||||
|
||||
MEM_write_1_byte(MEMADD_DISPLAY_ALIVE_TIME, CAR_CST.DISPLAY_ALIVE_TIME);
|
||||
|
||||
MEM_write_1_byte(MEMADD_DRIVE_SPEED_TIME, CAR_CST.DRIVE_SPEED_TIME);
|
||||
MEM_write_1_byte(MEMADD_DRIVE_STOP_TIME, CAR_CST.DRIVE_STOP_TIME);
|
||||
MEM_write_1_byte(MEMADD_DRIVE_ALIVE_TIME, CAR_CST.DRIVE_ALIVE_TIME);
|
||||
|
||||
MEM_write_1_byte(MEMADD_STEERING_ALIVE_TIME, CAR_CST.STEERING_ALIVE_TIME);
|
||||
|
||||
MEM_write_1_byte(MEMADD_BATTERY_VOLT_TIME, CAR_CST.BATTERY_VOLT_TIME);
|
||||
MEM_write_1_byte(MEMADD_BATTERY_CURRENT_TIME, CAR_CST.BATTERY_CURRENT_TIME);
|
||||
MEM_write_1_byte(MEMADD_BATTERY_ENERGY_TIME, CAR_CST.BATTERY_ENERGY_TIME);
|
||||
MEM_write_1_byte(MEMADD_BATTERY_ALIVE_TIME, CAR_CST.BATTERY_ALIVE_TIME);
|
||||
|
||||
MEM_write_1_byte(0x0, 0x42);
|
||||
} else {
|
||||
CAR_CST.CONTROL_STEERING_MODE = MEM_read_1_byte(MEMADD_CONTROL_STEERING_MODE);
|
||||
CAR_CST.CONTROL_ALIVE_TIME = MEM_read_1_byte(MEMADD_CONTROL_ALIVE_TIME);
|
||||
CAR_CST.CONTROL_SPEED_FACTOR = MEM_read_1_byte(MEMADD_CONTROL_SPEED_FACTOR);
|
||||
CAR_CST.CONTROL_POWER_FACTOR = MEM_read_1_byte(MEMADD_CONTROL_POWER_FACTOR);
|
||||
CAR_CST.CONTROL_STEERING_FACTOR = MEM_read_1_byte(MEMADD_CONTROL_STEERING_FACTOR);
|
||||
CAR_CST.CONTROL_MAX_SPEED_FW = MEM_read_1_byte(MEMADD_CONTROL_MAX_SPEED_FW);
|
||||
CAR_CST.CONTROL_MAX_SPEED_BW = MEM_read_1_byte(MEMADD_CONTROL_MAX_SPEED_BW);
|
||||
|
||||
CAR_CST.JOYSTICK_MODE = MEM_read_1_byte(MEMADD_JOYSTICK_MODE);
|
||||
CAR_CST.JOYSTICK_PARAM1 = MEM_read_1_byte(MEMADD_JOYSTICK_PARAM1);
|
||||
CAR_CST.JOYSTICK_PARAM2 = MEM_read_1_byte(MEMADD_JOYSTICK_PARAM2);
|
||||
CAR_CST.JOYSTICK_ALIVE_TIME = MEM_read_1_byte(MEMADD_JOYSTICK_ALIVE_TIME);
|
||||
|
||||
CAR_CST.DISPLAY_ALIVE_TIME = MEM_read_1_byte(MEMADD_DISPLAY_ALIVE_TIME);
|
||||
|
||||
CAR_CST.DRIVE_SPEED_TIME = MEM_read_1_byte(MEMADD_DRIVE_SPEED_TIME);
|
||||
CAR_CST.DRIVE_STOP_TIME = MEM_read_1_byte(MEMADD_DRIVE_STOP_TIME);
|
||||
CAR_CST.DRIVE_ALIVE_TIME = MEM_read_1_byte(MEMADD_DRIVE_ALIVE_TIME);
|
||||
|
||||
CAR_CST.STEERING_ALIVE_TIME = MEM_read_1_byte(MEMADD_STEERING_ALIVE_TIME);
|
||||
|
||||
CAR_CST.BATTERY_VOLT_TIME = MEM_read_1_byte(MEMADD_BATTERY_VOLT_TIME);
|
||||
CAR_CST.BATTERY_CURRENT_TIME = MEM_read_1_byte(MEMADD_BATTERY_CURRENT_TIME);
|
||||
CAR_CST.BATTERY_ENERGY_TIME = MEM_read_1_byte(MEMADD_BATTERY_ENERGY_TIME);
|
||||
CAR_CST.BATTERY_ALIVE_TIME = MEM_read_1_byte(MEMADD_BATTERY_ALIVE_TIME);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void MEM_write_1_byte(uint8_t address, uint8_t data) {
|
||||
DATAEE_WriteByte(address, data);
|
||||
}
|
||||
|
||||
void MEM_write_4_byte(uint8_t address, uint32_t data) {
|
||||
BYTES_4 tmpData;
|
||||
tmpData.full = data;
|
||||
for(uint8_t i = 0; i<4;i++) {
|
||||
uint8_t add = address;
|
||||
add += i;
|
||||
MEM_write_1_byte(add, tmpData.array[i]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
uint8_t MEM_read_1_byte(uint8_t address) {
|
||||
return DATAEE_ReadByte(address);
|
||||
}
|
||||
|
||||
uint32_t MEM_read_4_byte(uint8_t address) {
|
||||
BYTES_4 tmpData;
|
||||
for(uint8_t i = 0; i<4;i++) {
|
||||
uint8_t add = address;
|
||||
add += i;
|
||||
tmpData.array[i] = MEM_read_1_byte(add);
|
||||
}
|
||||
return tmpData.full;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
/**
|
||||
* @author R�mi Heredero
|
||||
* @version 1.0.0
|
||||
* @date August 2023
|
||||
* @file eeprom_interface.h
|
||||
*/
|
||||
#ifndef EEPROM_INTERFACE_H
|
||||
#define EEPROM_INTERFACE_H
|
||||
|
||||
#include <stdint.h> // usage of standard types
|
||||
#include <stdbool.h> // usage of boolean types
|
||||
#include "../mcc_generated_files/mcc.h"
|
||||
|
||||
void MEM_init();
|
||||
void MEM_write_1_byte(uint8_t address, uint8_t data);
|
||||
void MEM_write_4_byte(uint8_t address, uint32_t data);
|
||||
uint8_t MEM_read_1_byte(uint8_t address);
|
||||
uint32_t MEM_read_4_byte(uint8_t address);
|
||||
|
||||
#endif /* EEPROM_INTERFACE_H */
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,4 +1,4 @@
|
||||
<config configName="default" projectName="ss22ep" configVersion="1.1" device="PIC18F25K83" deviceLibraryClass="com.microchip.mcc.mcu8.Mcu8PeripheralLibrary" coreVersion="5.4.4">
|
||||
<config configName="default" projectName="ss22ep" configVersion="1.1" device="PIC18F26K83" deviceLibraryClass="com.microchip.mcc.mcu8.Mcu8PeripheralLibrary" coreVersion="5.4.11">
|
||||
<usedPackages class="java.util.ArrayList"/>
|
||||
<usedClasses class="java.util.TreeMap">
|
||||
<entry>
|
||||
@@ -1948,7 +1948,7 @@
|
||||
</entry>
|
||||
<entry>
|
||||
<key class="com.microchip.mcc.core.tokenManager.CustomKey" moduleName="DMA Manager" name="dmaTable"/>
|
||||
<value>{"dataArray":[{"DMA Channels":{"data":{"isDisable":"true","options":"--NONE--","text":"DMA CHANNEL1","value":"false"},"id":"DMA Channels_rowCount_0"},"Src Module":{"data":{"isDisable":"true","options":"--NONE--,TMR0,ECAN,MEMORY","text":"--NONE--","value":"--NONE--"},"id":"Src Module_rowCount_0"},"Src Region":{"data":{"isDisable":"true","options":"SFR#disabled,GPR#enabled,Program Flash#enabled,Data EEPROM#enabled","text":"GPR","value":"GPR"},"id":"Src Region_rowCount_0"},"Src SFR":{"Src SFR":{"isDisable":"true","options":"","text":"","value":""},"data":{"isDisable":"true","options":"","text":"","value":""},"id":"Src SFR_rowCount_0"},"Src VarName":{"data":{"isDisable":"true","options":"","text":"SrcVarName0","value":"SrcVarName0"},"Src VarName":{"isDisable":"true","options":"","text":"SrcVarName0","value":"SrcVarName0"},"id":"Src VarName_rowCount_0"},"Src VarSize":{"data":{"isDisable":"true","options":"","text":"10","value":"10"},"id":"Src VarSize_rowCount_0","Src VarSize":{"isDisable":"true","options":"","text":"10","value":"10"}},"Src Address":{"data":{"isDisable":"true","options":"","text":"Enter Address0","value":"Enter Address0"},"id":"Src Address_rowCount_0","Src Address":{"isDisable":"true","options":"","text":"Enter Address0","value":"Enter Address0"}},"Src Mode":{"Src Mode":{"isDisable":"true","options":"decremented,incremented,unchanged","text":"unchanged","value":"unchanged"},"data":{"isDisable":"true","options":"decremented,incremented,unchanged","text":"unchanged","value":"unchanged"},"id":"Src Mode_rowCount_0"},"Src Message Size":{"data":{"isDisable":"true","options":"","text":"1","value":"1"},"Src Message Size":{"isDisable":"true","options":"","text":"1","value":"1"},"id":"Src Message Size_rowCount_0"},"Dst Module":{"data":{"isDisable":"true","options":"--NONE--,TMR0,ECAN,MEMORY","text":"--NONE--","value":"--NONE--"},"id":"Dst Module_rowCount_0"},"Dst Region":{"data":{"isDisable":"true","options":"SFR,GPR","text":"GPR","value":"GPR"},"id":"Dst Region_rowCount_0"},"Dst SFR":{"Dst SFR":{"isDisable":"true","options":"","text":"","value":""},"data":{"isDisable":"true","options":"","text":"","value":""},"id":"Dst SFR_rowCount_0"},"Dst VarName":{"data":{"isDisable":"true","options":"","text":"DstVarName0","value":"DstVarName0"},"Dst VarName":{"isDisable":"true","options":"","text":"DstVarName0","value":"DstVarName0"},"id":"Dst VarName_rowCount_0"},"Dst VarSize":{"data":{"isDisable":"true","options":"","text":"10","value":"10"},"id":"Dst VarSize_rowCount_0","Dst VarSize":{"isDisable":"true",&Line truncated
|
||||
<value>{"dataArray":[{"DMA Channels":{"data":{"isDisable":"true","options":"--NONE--","text":"DMA CHANNEL1","value":"false"},"id":"DMA Channels_rowCount_0"},"Src Module":{"data":{"isDisable":"true","options":"--NONE--,MEMORY,ECAN,TMR0","text":"--NONE--","value":"--NONE--"},"id":"Src Module_rowCount_0"},"Src Region":{"data":{"isDisable":"true","options":"SFR#disabled,GPR#enabled,Program Flash#enabled,Data EEPROM#enabled","text":"GPR","value":"GPR"},"id":"Src Region_rowCount_0"},"Src SFR":{"Src SFR":{"isDisable":"true","options":"","text":"","value":""},"data":{"isDisable":"true","options":"","text":"","value":""},"id":"Src SFR_rowCount_0"},"Src VarName":{"data":{"isDisable":"true","options":"","text":"SrcVarName0","value":"SrcVarName0"},"Src VarName":{"isDisable":"true","options":"","text":"SrcVarName0","value":"SrcVarName0"},"id":"Src VarName_rowCount_0"},"Src VarSize":{"data":{"isDisable":"true","options":"","text":"10","value":"10"},"id":"Src VarSize_rowCount_0","Src VarSize":{"isDisable":"true","options":"","text":"10","value":"10"}},"Src Address":{"data":{"isDisable":"true","options":"","text":"Enter Address0","value":"Enter Address0"},"id":"Src Address_rowCount_0","Src Address":{"isDisable":"true","options":"","text":"Enter Address0","value":"Enter Address0"}},"Src Mode":{"Src Mode":{"isDisable":"true","options":"decremented,incremented,unchanged","text":"unchanged","value":"unchanged"},"data":{"isDisable":"true","options":"decremented,incremented,unchanged","text":"unchanged","value":"unchanged"},"id":"Src Mode_rowCount_0"},"Src Message Size":{"data":{"isDisable":"true","options":"","text":"1","value":"1"},"Src Message Size":{"isDisable":"true","options":"","text":"1","value":"1"},"id":"Src Message Size_rowCount_0"},"Dst Module":{"data":{"isDisable":"true","options":"--NONE--,MEMORY,ECAN,TMR0","text":"--NONE--","value":"--NONE--"},"id":"Dst Module_rowCount_0"},"Dst Region":{"data":{"isDisable":"true","options":"SFR,GPR","text":"GPR","value":"GPR"},"id":"Dst Region_rowCount_0"},"Dst SFR":{"Dst SFR":{"isDisable":"true","options":"","text":"","value":""},"data":{"isDisable":"true","options":"","text":"","value":""},"id":"Dst SFR_rowCount_0"},"Dst VarName":{"data":{"isDisable":"true","options":"","text":"DstVarName0","value":"DstVarName0"},"Dst VarName":{"isDisable":"true","options":"","text":"DstVarName0","value":"DstVarName0"},"id":"Dst VarName_rowCount_0"},"Dst VarSize":{"data":{"isDisable":"true","options":"","text":"10","value":"10"},"id":"Dst VarSize_rowCount_0","Dst VarSize":{"isDisable":"true",&Line truncated
|
||||
</entry>
|
||||
<entry>
|
||||
<key class="com.microchip.mcc.core.tokenManager.CustomKey" moduleName="ECAN" name="ECAN_ERRIISRFunction"/>
|
||||
@@ -17162,63 +17162,63 @@
|
||||
<generatedFileHashHistoryMap class="java.util.TreeMap">
|
||||
<entry>
|
||||
<file>main.c</file>
|
||||
<hash>91afd5df6694cfcd0279d66d9b5b3eb72a9c4eae825f0c0af82824e2ee66e35e</hash>
|
||||
<hash>cae37ae3b36cf22e97e106633433f5c00a66dd5d38ec353eb67fbbb0d88bde4d</hash>
|
||||
</entry>
|
||||
<entry>
|
||||
<file>mcc_generated_files\device_config.c</file>
|
||||
<hash>4288704a051756dce8bb92e77a82ba1285fc638cde56b3676b59406ba0fcea7b</hash>
|
||||
<hash>39a6d1181ef5eab59c7dde2c52a9ea889465d4da43262200f3322abc45e77739</hash>
|
||||
</entry>
|
||||
<entry>
|
||||
<file>mcc_generated_files\device_config.h</file>
|
||||
<hash>2f04b3ff01bbe49769634d389433c7010ffb45d0f2973898e33988be7ab07d56</hash>
|
||||
<hash>89c6172ff575ce515b93f2fbc85dcedc2978e58a8e0e1fbdc52e42511ae3bc05</hash>
|
||||
</entry>
|
||||
<entry>
|
||||
<file>mcc_generated_files\ecan.c</file>
|
||||
<hash>b60a119876875a2af386474d32176b8be0f47a074a2d8688e79251a2d7cdf6fa</hash>
|
||||
<hash>ea62f50d319e1e537d7632774728ad6a779f442e896d043dbdea8066d028a6c6</hash>
|
||||
</entry>
|
||||
<entry>
|
||||
<file>mcc_generated_files\ecan.h</file>
|
||||
<hash>0473fedf57d1376193e049ba507abed0960af84f0e416bea25972c4dae59ca26</hash>
|
||||
<hash>aa9a50aae81bab76b876ea6123777af7d6a6d0a58fe953be27e8b88776395b2e</hash>
|
||||
</entry>
|
||||
<entry>
|
||||
<file>mcc_generated_files\interrupt_manager.c</file>
|
||||
<hash>bb0eaf9aec0554de0106cff27f66e56ae02a40bbdcb68d4d58d8a0d84d8929f6</hash>
|
||||
<hash>df04edcd2c7d85ef90a8dbe4e46f1b1c9487b872153f4f2321249a4ce0d9635f</hash>
|
||||
</entry>
|
||||
<entry>
|
||||
<file>mcc_generated_files\interrupt_manager.h</file>
|
||||
<hash>313560861c27e0a0b39b2bbb6a64ac2068fd1937dc0339d7303ff241bbb52955</hash>
|
||||
<hash>9c2f1ae45f2ac887bb3e8b3763e1a394a6a22ffe4e9ae1c20c336fe6f12da1aa</hash>
|
||||
</entry>
|
||||
<entry>
|
||||
<file>mcc_generated_files\mcc.c</file>
|
||||
<hash>34fadc3a271040b358215ec477acf3e135b77137f9a1cc96def75fc2936d3ad6</hash>
|
||||
<hash>cc9ed44843b509879e6a3f676b561ecde91e1df88d855cf7eca77e1afc8920ca</hash>
|
||||
</entry>
|
||||
<entry>
|
||||
<file>mcc_generated_files\mcc.h</file>
|
||||
<hash>aead6835bc73f4332d9abb5de6c2a40829de25cc98452c4c69960d51b52844e9</hash>
|
||||
<hash>a2db7e36e878f686c2bf0c2ef586ef1c6570fa2f27119b4be7b52af6403091a4</hash>
|
||||
</entry>
|
||||
<entry>
|
||||
<file>mcc_generated_files\memory.c</file>
|
||||
<hash>ae2dbb373f8f03dd013cde153de046ba7c3c41033c1dedb8545cde41837ca3da</hash>
|
||||
<hash>17fb4759c4719b77287f6c4be48edfbcf117b5b8398b771c434f23aceac256e0</hash>
|
||||
</entry>
|
||||
<entry>
|
||||
<file>mcc_generated_files\memory.h</file>
|
||||
<hash>77a34d015c961db9ed465b4ca2d85ba910fb030ca14c3c2854428ab0b9b6fac2</hash>
|
||||
<hash>fbbca4e9d7ce92ddcc637d82b694a1f5cbefa75710a8a18bb1dc9ab5161f0924</hash>
|
||||
</entry>
|
||||
<entry>
|
||||
<file>mcc_generated_files\pin_manager.c</file>
|
||||
<hash>f8ace8a0b0d2a4f0ed3e209db056da57858e5a670ad7d514e44352d9187be806</hash>
|
||||
<hash>04b16a3d3fcbbb333ee6fb545a405b76aba47ef3935be548bf2b8165c43c5654</hash>
|
||||
</entry>
|
||||
<entry>
|
||||
<file>mcc_generated_files\pin_manager.h</file>
|
||||
<hash>3e61569926ed5f184a2267965f2cf7ca26dc997d552c213ebd94dbd80da54891</hash>
|
||||
<hash>611a409602fd8fba29be052e06a3ce86ad0a3b723b5e0f4c1a998854de7f9a7b</hash>
|
||||
</entry>
|
||||
<entry>
|
||||
<file>mcc_generated_files\tmr0.c</file>
|
||||
<hash>f9702dc8c67433ffc3b8db9e12ee3a73fb0b152a792d26f6c7a89a3846bc4fc9</hash>
|
||||
<hash>e0b4d075e819024ae77ea60a2c01182fdca45b783980cb50358d0a614736339d</hash>
|
||||
</entry>
|
||||
<entry>
|
||||
<file>mcc_generated_files\tmr0.h</file>
|
||||
<hash>68e2ba0f47166abd2da1a472d6a67bfde31f9be3edc8582ace93062a6a32f441</hash>
|
||||
<hash>6661ab783aae9f11e952805f9bca14209ec06551939552123056eefd5524fff8</hash>
|
||||
</entry>
|
||||
</generatedFileHashHistoryMap>
|
||||
</config>
|
||||
File diff suppressed because it is too large.
Load diff
@@ -28,7 +28,7 @@ typedef struct Timer_ // timer structure
|
||||
/* depending on usage, change MAXTIMER and MAXEVENT */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
#define MAXTIMER 8 // number of timers in our system
|
||||
#define MAXEVENT 12 // number of events in our system
|
||||
#define MAXEVENT 20 // number of events in our system
|
||||
|
||||
#define NULLTIMER 0 // no value for time
|
||||
#define TICKINTERVAL 10 // this is the ticktimers duration
|
||||
|
||||
Binary file not shown.
+123
-103
@@ -1,13 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<diagram program="umlet" version="15.0.0">
|
||||
<zoom_level>14</zoom_level>
|
||||
<zoom_level>15</zoom_level>
|
||||
<element>
|
||||
<id>UMLSpecialState</id>
|
||||
<coordinates>
|
||||
<x>266</x>
|
||||
<y>98</y>
|
||||
<w>28</w>
|
||||
<h>28</h>
|
||||
<x>510</x>
|
||||
<y>30</y>
|
||||
<w>30</w>
|
||||
<h>30</h>
|
||||
</coordinates>
|
||||
<panel_attributes>type=initial</panel_attributes>
|
||||
<additional_attributes/>
|
||||
@@ -15,115 +15,112 @@
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>266</x>
|
||||
<y>112</y>
|
||||
<w>112</w>
|
||||
<h>98</h>
|
||||
<x>510</x>
|
||||
<y>45</y>
|
||||
<w>90</w>
|
||||
<h>105</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=->
|
||||
evACinit</panel_attributes>
|
||||
evInit</panel_attributes>
|
||||
<additional_attributes>10.0;10.0;10.0;50.0</additional_attributes>
|
||||
</element>
|
||||
<element>
|
||||
<id>UMLState</id>
|
||||
<coordinates>
|
||||
<x>210</x>
|
||||
<y>182</y>
|
||||
<w>140</w>
|
||||
<h>56</h>
|
||||
<x>390</x>
|
||||
<y>120</y>
|
||||
<w>285</w>
|
||||
<h>90</h>
|
||||
</coordinates>
|
||||
<panel_attributes>STAC_SETUP</panel_attributes>
|
||||
<additional_attributes/>
|
||||
</element>
|
||||
<element>
|
||||
<id>UMLNote</id>
|
||||
<coordinates>
|
||||
<x>434</x>
|
||||
<y>182</y>
|
||||
<w>140</w>
|
||||
<h>42</h>
|
||||
</coordinates>
|
||||
<panel_attributes>Send params</panel_attributes>
|
||||
<additional_attributes/>
|
||||
</element>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>266</x>
|
||||
<y>224</y>
|
||||
<w>126</w>
|
||||
<h>98</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=->
|
||||
evACborn</panel_attributes>
|
||||
<additional_attributes>10.0;10.0;10.0;50.0</additional_attributes>
|
||||
</element>
|
||||
<element>
|
||||
<id>UMLState</id>
|
||||
<coordinates>
|
||||
<x>210</x>
|
||||
<y>294</y>
|
||||
<w>140</w>
|
||||
<h>56</h>
|
||||
</coordinates>
|
||||
<panel_attributes>STAC_BORN</panel_attributes>
|
||||
<additional_attributes/>
|
||||
</element>
|
||||
<element>
|
||||
<id>UMLState</id>
|
||||
<coordinates>
|
||||
<x>168</x>
|
||||
<y>406</y>
|
||||
<w>224</w>
|
||||
<h>84</h>
|
||||
</coordinates>
|
||||
<panel_attributes>STAC_WAIT
|
||||
<panel_attributes>SETUP
|
||||
--
|
||||
/entry: isAlive = false</panel_attributes>
|
||||
/entry: sendParamsOnCan</panel_attributes>
|
||||
<additional_attributes/>
|
||||
</element>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>266</x>
|
||||
<y>336</y>
|
||||
<w>140</w>
|
||||
<h>98</h>
|
||||
<x>510</x>
|
||||
<y>195</y>
|
||||
<w>105</w>
|
||||
<h>105</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=->
|
||||
evACready</panel_attributes>
|
||||
evBorn</panel_attributes>
|
||||
<additional_attributes>10.0;10.0;10.0;50.0</additional_attributes>
|
||||
</element>
|
||||
<element>
|
||||
<id>UMLState</id>
|
||||
<coordinates>
|
||||
<x>210</x>
|
||||
<y>658</y>
|
||||
<w>140</w>
|
||||
<h>56</h>
|
||||
<x>390</x>
|
||||
<y>270</y>
|
||||
<w>285</w>
|
||||
<h>90</h>
|
||||
</coordinates>
|
||||
<panel_attributes>STAC_DEAD</panel_attributes>
|
||||
<panel_attributes>BORN
|
||||
--
|
||||
/entry: init</panel_attributes>
|
||||
<additional_attributes/>
|
||||
</element>
|
||||
<element>
|
||||
<id>UMLState</id>
|
||||
<coordinates>
|
||||
<x>390</x>
|
||||
<y>420</y>
|
||||
<w>285</w>
|
||||
<h>120</h>
|
||||
</coordinates>
|
||||
<panel_attributes>WAIT
|
||||
--
|
||||
/entry: start children class
|
||||
--
|
||||
isAlive = false</panel_attributes>
|
||||
<additional_attributes/>
|
||||
</element>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>266</x>
|
||||
<y>476</y>
|
||||
<w>112</w>
|
||||
<h>98</h>
|
||||
<x>510</x>
|
||||
<y>345</y>
|
||||
<w>120</w>
|
||||
<h>105</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=->
|
||||
evACpoll</panel_attributes>
|
||||
evReady</panel_attributes>
|
||||
<additional_attributes>10.0;10.0;10.0;50.0</additional_attributes>
|
||||
</element>
|
||||
<element>
|
||||
<id>UMLState</id>
|
||||
<coordinates>
|
||||
<x>390</x>
|
||||
<y>720</y>
|
||||
<w>285</w>
|
||||
<h>90</h>
|
||||
</coordinates>
|
||||
<panel_attributes>DEAD
|
||||
--
|
||||
</panel_attributes>
|
||||
<additional_attributes/>
|
||||
</element>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>510</x>
|
||||
<y>525</y>
|
||||
<w>105</w>
|
||||
<h>105</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=->
|
||||
evPoll</panel_attributes>
|
||||
<additional_attributes>10.0;10.0;10.0;50.0</additional_attributes>
|
||||
</element>
|
||||
<element>
|
||||
<id>UMLSpecialState</id>
|
||||
<coordinates>
|
||||
<x>252</x>
|
||||
<y>546</y>
|
||||
<w>56</w>
|
||||
<h>56</h>
|
||||
<x>495</x>
|
||||
<y>600</y>
|
||||
<w>60</w>
|
||||
<h>60</h>
|
||||
</coordinates>
|
||||
<panel_attributes>type=decision</panel_attributes>
|
||||
<additional_attributes/>
|
||||
@@ -131,48 +128,71 @@ evACpoll</panel_attributes>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>266</x>
|
||||
<y>588</y>
|
||||
<w>84</w>
|
||||
<h>98</h>
|
||||
<x>510</x>
|
||||
<y>645</y>
|
||||
<w>90</w>
|
||||
<h>105</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=->
|
||||
m1=[else]</panel_attributes>
|
||||
<additional_attributes>10.0;10.0;10.0;50.0</additional_attributes>
|
||||
</element>
|
||||
<element>
|
||||
<id>UMLNote</id>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>434</x>
|
||||
<y>294</y>
|
||||
<w>140</w>
|
||||
<h>42</h>
|
||||
<x>315</x>
|
||||
<y>465</y>
|
||||
<w>210</w>
|
||||
<h>210</h>
|
||||
</coordinates>
|
||||
<panel_attributes>Reset / Init</panel_attributes>
|
||||
<additional_attributes/>
|
||||
<panel_attributes>lt=->
|
||||
m1=[isAlive]</panel_attributes>
|
||||
<additional_attributes>120.0;110.0;10.0;110.0;10.0;10.0;50.0;10.0</additional_attributes>
|
||||
</element>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>294</x>
|
||||
<y>420</y>
|
||||
<w>182</w>
|
||||
<h>196</h>
|
||||
<x>660</x>
|
||||
<y>135</y>
|
||||
<w>210</w>
|
||||
<h>405</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=->
|
||||
m1=[alive]</panel_attributes>
|
||||
<additional_attributes>10.0;110.0;110.0;110.0;110.0;10.0;70.0;10.0</additional_attributes>
|
||||
evDisable</panel_attributes>
|
||||
<additional_attributes>10.0;250.0;60.0;250.0;60.0;10.0;10.0;10.0</additional_attributes>
|
||||
</element>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>140</x>
|
||||
<y>308</y>
|
||||
<w>168</w>
|
||||
<h>490</h>
|
||||
<x>255</x>
|
||||
<y>300</y>
|
||||
<w>300</w>
|
||||
<h>600</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=->
|
||||
evACborn</panel_attributes>
|
||||
<additional_attributes>100.0;290.0;100.0;330.0;10.0;330.0;10.0;10.0;50.0;10.0</additional_attributes>
|
||||
evBorn</panel_attributes>
|
||||
<additional_attributes>180.0;340.0;180.0;380.0;10.0;380.0;10.0;10.0;90.0;10.0</additional_attributes>
|
||||
</element>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>660</x>
|
||||
<y>495</y>
|
||||
<w>120</w>
|
||||
<h>315</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=-</panel_attributes>
|
||||
<additional_attributes>10.0;190.0;60.0;190.0;60.0;10.0</additional_attributes>
|
||||
</element>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>660</x>
|
||||
<y>315</y>
|
||||
<w>120</w>
|
||||
<h>45</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=-</panel_attributes>
|
||||
<additional_attributes>10.0;10.0;60.0;10.0</additional_attributes>
|
||||
</element>
|
||||
</diagram>
|
||||
@@ -0,0 +1,29 @@
|
||||
@startuml
|
||||
|
||||
actor CAN_BUS as bus
|
||||
participant interrupt as ISR
|
||||
queue XF as xf
|
||||
participant ecan as ecan
|
||||
participant can_interface as can
|
||||
control can_message as msg
|
||||
|
||||
|
||||
bus -\\ ISR ++ : can message
|
||||
ISR -> can : newMsg
|
||||
can -> ecan : read
|
||||
ecan --> can : message
|
||||
can -> xf : POST XF
|
||||
destroy ISR
|
||||
group clock xf [every 10ms]
|
||||
xf o-> can : receiveCan
|
||||
can -> msg : processIncome
|
||||
msg -> can : create message
|
||||
can -> xf : POST XF
|
||||
end
|
||||
group clock xf [every 10ms]
|
||||
xf o-> can : sendCan
|
||||
can -> ecan : write
|
||||
ecan -\\ bus : can message
|
||||
end
|
||||
|
||||
@enduml
|
||||
+8
-1
@@ -6,7 +6,7 @@
|
||||
|
||||
[BUSMASTER_VERSION] [3.2.2]
|
||||
|
||||
[NUMBER_OF_MESSAGES] 25
|
||||
[NUMBER_OF_MESSAGES] 26
|
||||
|
||||
[START_MSG] JOY_MEASURE,529,3,3,1,S
|
||||
[START_SIGNALS] posX,8,1,0,I,127,-128,1,0.000000,1.000000,%,
|
||||
@@ -150,4 +150,11 @@
|
||||
|
||||
[START_MSG] STEERING_GET_POS,1298,4,1,1,S
|
||||
[START_SIGNALS] POSITION,32,4,0,I,2147483647,-2147483648,0,0.000000,1.000000,qc,
|
||||
[END_MSG]
|
||||
|
||||
[START_MSG] CONTROL_SETUP_PARAM_JOY,22,4,4,1,S
|
||||
[START_SIGNALS] mode,1,1,0,B,1,0,1,0.000000,1.000000,,
|
||||
[START_SIGNALS] timeMeasureOrDeltaX,8,2,0,U,255,0,1,0.000000,10.000000,msOrVal,
|
||||
[START_SIGNALS] DeltaY,8,3,0,U,255,0,1,0.000000,1.000000,val,
|
||||
[START_SIGNALS] aliveTime,8,4,0,U,255,0,1,0.000000,10.000000,ms,
|
||||
[END_MSG]
|
||||
Reference in new issue
Block a user