Files
VK035_Template/Core/App/main.c
Razvalyaev f3e76e105a Добавлено:
- рефакторинг названий:
	- маленькие буквы - инит периферии
	- ТакойСтильФункций - API для использования
- сделаны шапки с инструкциями к функциями
- доработан ацп секвенсора
- доработан систем тики. можно настроить его на разные частоты и подключить коллбеки на разный период
- в gpio добавлены функции для кнопок и диодов
- генерация бинарника
2025-12-27 23:20:03 +03:00

59 lines
1.6 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*==============================================================================
* Шаблон проекта для К1921ВК035 с использованием бибилотеки PLIB035
*------------------------------------------------------------------------------
* ЦНИИ СЭТ, Разваляев Алексей <wot890089@mail.ru>
*==============================================================================
* ЦНИИ СЭТ
*==============================================================================
*/
//-- Includes ------------------------------------------------------------------
#include "main.h"
//-- Defines -------------------------------------------------------------------
//-- Peripheral init functions -------------------------------------------------
void periph_init()
{
sysclk_init();
uart_init_first();
adc_init_first();
tmr_init_first();
gpio_init();
#ifdef RETARGET
retarget_init();
#endif
NVIC_SetAllPriorities();
printf("\nAll peripherals inited, SYSCLK = %3d MHz\n", (int)(SystemCoreClock / 1E6));
}
//-- Main ----------------------------------------------------------------------
int main()
{
periph_init();
while (1)
{
};
//return 0;
}
//-- Assert --------------------------------------------------------------------
void Error_Handler(void)
{
__disable_irq();
while (1)
{
}
}
#if defined USE_FULL_ASSERT
void assert_failed(uint8_t* file, uint32_t line)
{
printf("Assert failed: file %s on line %d\n", file, (int)line);
while (1) {
};
}
#endif /* USE_FULL_ASSERT */