Initial commit

This commit is contained in:
2025-10-22 20:40:25 +03:00
commit 63d038ee63
57 changed files with 104378 additions and 0 deletions

99
libs/CanFwInterface.cpp Normal file
View File

@@ -0,0 +1,99 @@
/*
* CanFwInterface.cpp
*
* Created on: 13 мая 2015 г.
* Author: esaulenko
*/
#include "ModelName.h"
#include "source/SourcePath.h"
#include SRC_HEADER
#include "CanFwInterface.h"
#include "Utils.h"
#include "Settings.h"
#include "Version.h"
#include <stddef.h>
// заглушка для неиспользуемых функций
//void Empty (__attribute__((unused)) void * apCanFwMem) {};
void Empty () {};
// контрольная сумма, располагается линкером в самом конце прошивки
__attribute__ ((section(".CheckSum")))
static const uint32_t CanChksum = CHKSUM_DEBUG;
// описание прошивки
const TCanFwInfo gCanFwInfo =
{
(CAN_FW_VERSION << 24) | BUILD_DATE, // Version - Версия ПО
GIT_BUILD, // Хеш коммита в репозитории git
&CanChksum, // *pCRC32 - Адрес, где расположена CRC32
0, // reserved2
M_NAME CAN_FW_DESCRIPTION "_" GIT_VERSION // TextInfo[64] - Текстовая информация
};
// структура с функциями CAN, которые вызываются из ядра
__attribute__ ((section(".entrance_vector")))
TCanFunctions CanFuctTable =
{
&gCanFwInfo, // pCanFwInfo
(uint8_t *) & CSettings::CanSettingsTable, // pSettingsTable
CSettings::CanSettingsName, // pSettingsNames
Init,
PeriodicProcess,
SettingChanged,
Empty, // Reserved6
InputChanged,
OutputChanged,
GuardEvent,
Can1Received,
Can2Received,
SequenceStart,
SequenceStop,
Command,
Lin1Received,
Lin2Received,
Lin1Transmitted,
Lin2Transmitted,
#if defined MOBICAR_1_2
Empty, // Reserved19
Empty, // Reserved20
#elif defined MOBICAR_3
Lin3Received,
Lin3Transmitted,
#endif
Empty, // Reserved21
Empty, // Reserved22
Empty, // Reserved23
Empty, // Reserved24
Empty, // Reserved25
Empty, // Reserved26
Empty, // Reserved27
Empty, // Reserved28
Empty, // Reserved29
Empty, // Reserved30
Empty, // Reserved31
};
// проверка, что переменные влезают в соотв.область
static_assert (sizeof(TCanFwMem) <= gCanFwMemSize, "Превышен максимальный размер TCanFwMem");