Добавлены интерфейсы и драйверы

This commit is contained in:
cfif 2025-09-30 15:52:33 +03:00
parent 392f342052
commit 4dec2ef0a8
5 changed files with 165 additions and 62 deletions

View File

@ -13,6 +13,7 @@
/* ################################################################################## */ /* ################################################################################## */
/* ########################### Local Prototype Functions ############################ */ /* ########################### Local Prototype Functions ############################ */
static void Bsp_SCG_Init(void); static void Bsp_SCG_Init(void);
static void Bsp_PCC_Init(void); static void Bsp_PCC_Init(void);
/* ################################################################################## */ /* ################################################################################## */
@ -23,8 +24,7 @@ static void Bsp_PCC_Init(void);
* @brief Local SCG initial * @brief Local SCG initial
* *
*/ */
static void Bsp_SCG_Init(void) static void Bsp_SCG_Init(void) {
{
/* Enable FOSC, frequency is 24M, DIVH=DIV1(24M), DIVM=DIV1(24M), DIVL=DIV2(12M)*/ /* Enable FOSC, frequency is 24M, DIVH=DIV1(24M), DIVM=DIV1(24M), DIVL=DIV2(12M)*/
SCG_FoscType tFoscStruct = SCG_FoscType tFoscStruct =
{ {
@ -100,14 +100,14 @@ static void Bsp_SCG_Init(void)
.eDivCore = SCG_CLOCK_DIV_BY1 .eDivCore = SCG_CLOCK_DIV_BY1
}; };
SCG_SetClkCtrl(&tClockStruct); SCG_SetClkCtrl(&tClockStruct);
} }
/** /**
* @brief Local PCC Initial * @brief Local PCC Initial
* *
*/ */
static void Bsp_PCC_Init(void) static void Bsp_PCC_Init(void) {
{
PCC_CtrlType bSP_PCC_Config; PCC_CtrlType bSP_PCC_Config;
/* DMA 0 */ /* DMA 0 */
@ -139,8 +139,7 @@ static void Bsp_PCC_Init(void)
* @brief General Clock Initial * @brief General Clock Initial
* *
*/ */
void Bsp_CLOCK_Init(void) void Bsp_CLOCK_Init(void) {
{
SCG_Deinit(); SCG_Deinit();
Bsp_SCG_Init(); Bsp_SCG_Init();
Bsp_PCC_Init(); Bsp_PCC_Init();

View File

@ -115,7 +115,6 @@ SECTIONS
. = ALIGN(4); . = ALIGN(4);
} > SRAM1 } > SRAM1
__HeapBegin = ORIGIN(DTCM_STACK); __HeapBegin = ORIGIN(DTCM_STACK);
__HeapLimit = ORIGIN(DTCM_STACK) + 0x200 - 8; __HeapLimit = ORIGIN(DTCM_STACK) + 0x200 - 8;
@ -125,5 +124,21 @@ SECTIONS
__rom_data_start = LOADADDR(.data); __rom_data_start = LOADADDR(.data);
__rom_ncache_data_start = LOADADDR(.ncache_data); __rom_ncache_data_start = LOADADDR(.ncache_data);
/* User_heap_stack section, used to check that there is enough RAM left */
_Min_Heap_Size = 0x200; /* required amount of heap */
_Min_Stack_Size = 0x400; /* required amount of stack */
._user_heap_stack :
{
. = ALIGN(8);
PROVIDE ( end = . );
PROVIDE ( _end = . );
. = . + _Min_Heap_Size;
. = . + _Min_Stack_Size;
. = ALIGN(8);
} > DTCM_STACK
} }

View File

@ -76,7 +76,7 @@ extern uint32_t SystemCoreClock;
#define configTICK_RATE_HZ ((TickType_t)1000) #define configTICK_RATE_HZ ((TickType_t)1000)
#define configMAX_PRIORITIES ( 56 ) #define configMAX_PRIORITIES ( 56 )
#define configMINIMAL_STACK_SIZE ((uint16_t)64) #define configMINIMAL_STACK_SIZE ((uint16_t)64)
#define configTOTAL_HEAP_SIZE ((size_t)52000) #define configTOTAL_HEAP_SIZE ((size_t)32000)
#define configMAX_TASK_NAME_LEN ( 16 ) #define configMAX_TASK_NAME_LEN ( 16 )
#define configUSE_TRACE_FACILITY 1 #define configUSE_TRACE_FACILITY 1
#define configUSE_16_BIT_TICKS 0 #define configUSE_16_BIT_TICKS 0

View File

@ -3,6 +3,12 @@
// //
#include "Clock.h" #include "Clock.h"
#include "cmsis_os.h" #include "cmsis_os.h"
#include "MainModesArbiter.h"
#include "PeripheralInterfaces.h"
#include <stdlib.h>
tMma MAIN_ENV;
_Noreturn void stop() { _Noreturn void stop() {
while (1) { while (1) {
@ -26,7 +32,14 @@ int main(void)
osKernelInitialize(); osKernelInitialize();
Mma_Init(&MAIN_ENV, &GPIOS, &SERIAL_PORTS, &RTCS);
Mma_StartThread(&MAIN_ENV);
osKernelStart(); osKernelStart();
volatile int *p = (int *) malloc(10000 * sizeof(int));
STOP STOP
} }

View File

@ -80,6 +80,82 @@
"repo": "SerialPort_P2P_CmsisRtos" "repo": "SerialPort_P2P_CmsisRtos"
}, },
{
"type": "git",
"provider": "HVAC_M7",
"repo": "HVAC_M7_DebugTesting"
},
{
"type": "git",
"provider": "HVAC_M7",
"repo": "HVAC_M7_Indication"
},
{
"type": "git",
"provider": "HVAC_M7",
"repo": "BaseTypes"
},
{
"type": "git",
"provider": "HVAC_M7",
"repo": "LoggerToSerialPort"
},
{
"type": "git",
"provider": "HVAC_M7",
"repo": "HVAC_M7_PowerManagement"
},
{
"type": "git",
"provider": "HVAC_M7",
"repo": "HVAC_M7_ComInt"
},
{
"type": "git",
"provider": "HVAC_M7",
"repo": "HVAC_M7_Command"
},
{
"type": "git",
"provider": "HVAC_M7",
"repo": "HVAC_M7_Rtcs"
},
{
"type": "git",
"provider": "HVAC_M7",
"repo": "Rtc_Flagchip_FC7240"
},
{
"type": "git",
"provider": "HVAC_M7",
"repo": "VariablesTable"
},
{
"type": "git",
"provider": "HVAC_M7",
"repo": "ComIntCmd_Vars"
},
{
"type": "git",
"provider": "HVAC_M7",
"repo": "FirmwareMetadataSection"
},
{ {
"type": "local", "type": "local",