Compare commits

..

10 Commits

22 changed files with 17363 additions and 108 deletions

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
.idea

View File

@@ -19,7 +19,7 @@
#include "../../middleware/alive_checker.h"
#include "../../middleware/can_interface.h"
#include "../../middleware/watchdog.h"
#include "../../middleware/eeprom_interface.h"
#include "../../middleware/eeprom.h"
typedef struct {

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -5,7 +5,7 @@
* @file eeprom_interface.h
*/
#include "eeprom_interface.h"
#include "eeprom.h"
#include "../app/car.h"
typedef union {
@@ -33,20 +33,20 @@ void MEM_init(){
CAR_CST.JOYSTICK_MODE = 0;
CAR_CST.JOYSTICK_PARAM1 = 100;
CAR_CST.JOYSTICK_PARAM2 = 1;
CAR_CST.JOYSTICK_ALIVE_TIME = 50;
CAR_CST.JOYSTICK_ALIVE_TIME = 10;
CAR_CST.DISPLAY_ALIVE_TIME = 0;
CAR_CST.DISPLAY_ALIVE_TIME = 50;
CAR_CST.DRIVE_SPEED_TIME = 0;
CAR_CST.DRIVE_STOP_TIME = 0;
CAR_CST.DRIVE_ALIVE_TIME = 0;
CAR_CST.DRIVE_ALIVE_TIME = 10;
CAR_CST.STEERING_ALIVE_TIME = 0;
CAR_CST.STEERING_ALIVE_TIME = 100;
CAR_CST.BATTERY_VOLT_TIME = 0;
CAR_CST.BATTERY_CURRENT_TIME = 0;
CAR_CST.BATTERY_ENERGY_TIME = 0;
CAR_CST.BATTERY_ALIVE_TIME = 0;
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);

View File

@@ -8,6 +8,7 @@
<itemPath>app/factory/factory.h</itemPath>
<itemPath>app/car.h</itemPath>
<itemPath>app/can_message.h</itemPath>
<itemPath>middleware/eeprom.h</itemPath>
</logicalFolder>
<logicalFolder name="board" displayName="board" projectFiles="true">
<itemPath>board/led/led.h</itemPath>
@@ -27,7 +28,6 @@
<itemPath>middleware/can_interface.h</itemPath>
<itemPath>middleware/alive_checker.h</itemPath>
<itemPath>middleware/watchdog.h</itemPath>
<itemPath>middleware/eeprom_interface.h</itemPath>
</logicalFolder>
<logicalFolder name="xf" displayName="xf" projectFiles="true">
<itemPath>xf/event.h</itemPath>
@@ -45,6 +45,7 @@
<logicalFolder name="app" displayName="app" projectFiles="true">
<itemPath>app/factory/factory.c</itemPath>
<itemPath>app/can_message.c</itemPath>
<itemPath>middleware/eeprom.c</itemPath>
</logicalFolder>
<logicalFolder name="board" displayName="board" projectFiles="true">
<itemPath>board/led/led.c</itemPath>
@@ -64,7 +65,6 @@
<itemPath>middleware/can_interface.c</itemPath>
<itemPath>middleware/alive_checker.c</itemPath>
<itemPath>middleware/watchdog.c</itemPath>
<itemPath>middleware/eeprom_interface.c</itemPath>
</logicalFolder>
<logicalFolder name="xf" displayName="xf" projectFiles="true">
<itemPath>xf/event.c</itemPath>
@@ -88,13 +88,13 @@
<conf name="default" type="2">
<toolsSet>
<developmentServer>localhost</developmentServer>
<targetDevice>PIC18F25K83</targetDevice>
<targetDevice>PIC18F26K83</targetDevice>
<targetHeader></targetHeader>
<targetPluginBoard></targetPluginBoard>
<platformTool>PICkit3PlatformTool</platformTool>
<languageToolchain>XC8</languageToolchain>
<languageToolchainVersion>2.41</languageToolchainVersion>
<platform>3</platform>
<platform>2</platform>
</toolsSet>
<packs>
<pack name="PIC18F-K_DFP" vendor="Microchip" version="1.7.134"/>
@@ -216,6 +216,7 @@
<property key="debugoptions.debug-startup" value="Use system settings"/>
<property key="debugoptions.reset-behaviour" value="Use system settings"/>
<property key="debugoptions.useswbreakpoints" value="false"/>
<property key="firmware.download.all" value="false"/>
<property key="hwtoolclock.frcindebug" value="false"/>
<property key="memories.aux" value="false"/>
<property key="memories.bootflash" value="true"/>
@@ -238,7 +239,7 @@
<property key="programoptions.preservedataflash" value="false"/>
<property key="programoptions.preservedataflash.ranges"
value="${programoptions.preservedataflash.ranges}"/>
<property key="programoptions.preserveeeprom" value="true"/>
<property key="programoptions.preserveeeprom" value="false"/>
<property key="programoptions.preserveeeprom.ranges" value="310000-3103ff"/>
<property key="programoptions.preserveprogram.ranges" value=""/>
<property key="programoptions.preserveprogramrange" value="false"/>
@@ -777,7 +778,7 @@
<property key="programoptions.preservedataflash" value="false"/>
<property key="programoptions.preservedataflash.ranges"
value="${programoptions.preservedataflash.ranges}"/>
<property key="programoptions.preserveeeprom" value="true"/>
<property key="programoptions.preserveeeprom" value="false"/>
<property key="programoptions.preserveeeprom.ranges" value="310000-3103ff"/>
<property key="programoptions.preserveprogram.ranges" value=""/>
<property key="programoptions.preserveprogramrange" value="false"/>

View File

@@ -1,4 +1,4 @@
<config configName="default" projectName="ss22ep" configVersion="1.1" device="PIC18F25K83" deviceLibraryClass="com.microchip.mcc.mcu8.Mcu8PeripheralLibrary" coreVersion="5.5.7">
<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>
@@ -17159,66 +17159,66 @@
<value>Window delay time 87.5%</value>
</entry>
</tokenMap>
<generatedFileHashHistoryMap class="java.util.HashMap">
<entry>
<file>mcc_generated_files\interrupt_manager.h</file>
<hash>313560861c27e0a0b39b2bbb6a64ac2068fd1937dc0339d7303ff241bbb52955</hash>
</entry>
<entry>
<file>mcc_generated_files\mcc.h</file>
<hash>aead6835bc73f4332d9abb5de6c2a40829de25cc98452c4c69960d51b52844e9</hash>
</entry>
<entry>
<file>mcc_generated_files\device_config.h</file>
<hash>2f04b3ff01bbe49769634d389433c7010ffb45d0f2973898e33988be7ab07d56</hash>
</entry>
<entry>
<file>mcc_generated_files\memory.c</file>
<hash>ae2dbb373f8f03dd013cde153de046ba7c3c41033c1dedb8545cde41837ca3da</hash>
</entry>
<entry>
<file>mcc_generated_files\tmr0.h</file>
<hash>68e2ba0f47166abd2da1a472d6a67bfde31f9be3edc8582ace93062a6a32f441</hash>
</entry>
<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\pin_manager.h</file>
<hash>3e61569926ed5f184a2267965f2cf7ca26dc997d552c213ebd94dbd80da54891</hash>
</entry>
<entry>
<file>mcc_generated_files\tmr0.c</file>
<hash>f9702dc8c67433ffc3b8db9e12ee3a73fb0b152a792d26f6c7a89a3846bc4fc9</hash>
</entry>
<entry>
<file>mcc_generated_files\pin_manager.c</file>
<hash>f8ace8a0b0d2a4f0ed3e209db056da57858e5a670ad7d514e44352d9187be806</hash>
<file>mcc_generated_files\device_config.h</file>
<hash>89c6172ff575ce515b93f2fbc85dcedc2978e58a8e0e1fbdc52e42511ae3bc05</hash>
</entry>
<entry>
<file>mcc_generated_files\ecan.c</file>
<hash>b60a119876875a2af386474d32176b8be0f47a074a2d8688e79251a2d7cdf6fa</hash>
</entry>
<entry>
<file>mcc_generated_files\interrupt_manager.c</file>
<hash>bb0eaf9aec0554de0106cff27f66e56ae02a40bbdcb68d4d58d8a0d84d8929f6</hash>
</entry>
<entry>
<file>mcc_generated_files\mcc.c</file>
<hash>34fadc3a271040b358215ec477acf3e135b77137f9a1cc96def75fc2936d3ad6</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>df04edcd2c7d85ef90a8dbe4e46f1b1c9487b872153f4f2321249a4ce0d9635f</hash>
</entry>
<entry>
<file>mcc_generated_files\interrupt_manager.h</file>
<hash>9c2f1ae45f2ac887bb3e8b3763e1a394a6a22ffe4e9ae1c20c336fe6f12da1aa</hash>
</entry>
<entry>
<file>mcc_generated_files\mcc.c</file>
<hash>cc9ed44843b509879e6a3f676b561ecde91e1df88d855cf7eca77e1afc8920ca</hash>
</entry>
<entry>
<file>mcc_generated_files\mcc.h</file>
<hash>a2db7e36e878f686c2bf0c2ef586ef1c6570fa2f27119b4be7b52af6403091a4</hash>
</entry>
<entry>
<file>mcc_generated_files\memory.c</file>
<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>04b16a3d3fcbbb333ee6fb545a405b76aba47ef3935be548bf2b8165c43c5654</hash>
</entry>
<entry>
<file>mcc_generated_files\pin_manager.h</file>
<hash>611a409602fd8fba29be052e06a3ce86ad0a3b723b5e0f4c1a998854de7f9a7b</hash>
</entry>
<entry>
<file>mcc_generated_files\tmr0.c</file>
<hash>e0b4d075e819024ae77ea60a2c01182fdca45b783980cb50358d0a614736339d</hash>
</entry>
<entry>
<file>mcc_generated_files\tmr0.h</file>
<hash>6661ab783aae9f11e952805f9bca14209ec06551939552123056eefd5524fff8</hash>
</entry>
</generatedFileHashHistoryMap>
</config>

File diff suppressed because one or more lines are too long

BIN
UML/alive.pdf Normal file

Binary file not shown.

View File

@@ -4,8 +4,8 @@
<element>
<id>UMLSpecialState</id>
<coordinates>
<x>735</x>
<y>45</y>
<x>510</x>
<y>30</y>
<w>30</w>
<h>30</h>
</coordinates>
@@ -15,8 +15,8 @@
<element>
<id>Relation</id>
<coordinates>
<x>735</x>
<y>60</y>
<x>510</x>
<y>45</y>
<w>90</w>
<h>105</h>
</coordinates>
@@ -27,8 +27,8 @@ evInit</panel_attributes>
<element>
<id>UMLState</id>
<coordinates>
<x>615</x>
<y>135</y>
<x>390</x>
<y>120</y>
<w>285</w>
<h>90</h>
</coordinates>
@@ -40,8 +40,8 @@ evInit</panel_attributes>
<element>
<id>Relation</id>
<coordinates>
<x>735</x>
<y>210</y>
<x>510</x>
<y>195</y>
<w>105</w>
<h>105</h>
</coordinates>
@@ -52,8 +52,8 @@ evBorn</panel_attributes>
<element>
<id>UMLState</id>
<coordinates>
<x>615</x>
<y>285</y>
<x>390</x>
<y>270</y>
<w>285</w>
<h>90</h>
</coordinates>
@@ -65,8 +65,8 @@ evBorn</panel_attributes>
<element>
<id>UMLState</id>
<coordinates>
<x>615</x>
<y>435</y>
<x>390</x>
<y>420</y>
<w>285</w>
<h>120</h>
</coordinates>
@@ -80,8 +80,8 @@ isAlive = false</panel_attributes>
<element>
<id>Relation</id>
<coordinates>
<x>735</x>
<y>360</y>
<x>510</x>
<y>345</y>
<w>120</w>
<h>105</h>
</coordinates>
@@ -92,8 +92,8 @@ evReady</panel_attributes>
<element>
<id>UMLState</id>
<coordinates>
<x>615</x>
<y>735</y>
<x>390</x>
<y>720</y>
<w>285</w>
<h>90</h>
</coordinates>
@@ -105,8 +105,8 @@ evReady</panel_attributes>
<element>
<id>Relation</id>
<coordinates>
<x>735</x>
<y>540</y>
<x>510</x>
<y>525</y>
<w>105</w>
<h>105</h>
</coordinates>
@@ -117,8 +117,8 @@ evPoll</panel_attributes>
<element>
<id>UMLSpecialState</id>
<coordinates>
<x>720</x>
<y>615</y>
<x>495</x>
<y>600</y>
<w>60</w>
<h>60</h>
</coordinates>
@@ -128,8 +128,8 @@ evPoll</panel_attributes>
<element>
<id>Relation</id>
<coordinates>
<x>735</x>
<y>660</y>
<x>510</x>
<y>645</y>
<w>90</w>
<h>105</h>
</coordinates>
@@ -140,8 +140,8 @@ m1=[else]</panel_attributes>
<element>
<id>Relation</id>
<coordinates>
<x>540</x>
<y>480</y>
<x>315</x>
<y>465</y>
<w>210</w>
<h>210</h>
</coordinates>
@@ -152,8 +152,8 @@ m1=[isAlive]</panel_attributes>
<element>
<id>Relation</id>
<coordinates>
<x>885</x>
<y>150</y>
<x>660</x>
<y>135</y>
<w>210</w>
<h>405</h>
</coordinates>
@@ -164,8 +164,8 @@ evDisable</panel_attributes>
<element>
<id>Relation</id>
<coordinates>
<x>480</x>
<y>315</y>
<x>255</x>
<y>300</y>
<w>300</w>
<h>600</h>
</coordinates>
@@ -176,8 +176,8 @@ evBorn</panel_attributes>
<element>
<id>Relation</id>
<coordinates>
<x>885</x>
<y>510</y>
<x>660</x>
<y>495</y>
<w>120</w>
<h>315</h>
</coordinates>
@@ -187,8 +187,8 @@ evBorn</panel_attributes>
<element>
<id>Relation</id>
<coordinates>
<x>885</x>
<y>330</y>
<x>660</x>
<y>315</y>
<w>120</w>
<h>45</h>
</coordinates>

29
UML/can.puml Normal file
View File

@@ -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