Browse Source

whatever

cmake_2_makefile
heck 2 years ago
parent
commit
a76b5414c5
  1. 1
      .gitignore
  2. 14
      src/cppmain.cc
  3. 1
      src/init.c

1
.gitignore

@ -6,4 +6,5 @@
*.bin *.bin
*.hex *.hex
*.map *.map
*.DS_Store
.idea .idea

14
src/cppmain.cc

@ -177,7 +177,7 @@ namespace Heck {
// C Linkage (Bridging) // C Linkage (Bridging)
// ---------------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------------
void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) extern "C" void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
{ {
if (GPIO_Pin == GPIO_PIN_0) { if (GPIO_Pin == GPIO_PIN_0) {
Heck::irq1_cb(); Heck::irq1_cb();
@ -186,7 +186,7 @@ void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
} }
} }
void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim) extern "C" void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
{ {
if (htim->Instance == TIM2) { if (htim->Instance == TIM2) {
Heck::log( Heck::log(
@ -210,17 +210,17 @@ void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
} }
void HAL_DAC_ConvCpltCallbackCh1(DAC_HandleTypeDef *hdac) extern "C" void HAL_DAC_ConvCpltCallbackCh1(DAC_HandleTypeDef *hdac)
{ {
Heck::dac_start_dma(); Heck::dac_start_dma();
} }
void heck_log(char *msg) extern "C" void heck_log(char *msg)
{ {
Heck::log(std::string(msg)); Heck::log(std::string(msg));
} }
void heck_cppmain(void) extern "C" void heck_cppmain(void)
{ {
Heck::main(); Heck::main();
} }
@ -232,7 +232,7 @@ void heck_cppmain(void)
* @param line: assert_param error line source number * @param line: assert_param error line source number
* @retval None * @retval None
*/ */
void assert_failed(uint8_t *file, uint32_t line) extern "C" void assert_failed(uint8_t *file, uint32_t line)
{ {
/* User can add his own implementation to report the file name and line number, /* User can add his own implementation to report the file name and line number,
ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */ ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
@ -242,7 +242,7 @@ void assert_failed(uint8_t *file, uint32_t line)
heck_log(str); heck_log(str);
} }
void Error_Handler(void) extern "C" void Error_Handler(void)
{ {
heck_log("Error_Handler StR1keZ!"); heck_log("Error_Handler StR1keZ!");
__disable_irq(); __disable_irq();

1
src/init.c

@ -292,4 +292,5 @@ void heck_init()
rng_init(); rng_init();
irq_init(); irq_init();
dma_init(); dma_init();
} }

Loading…
Cancel
Save