diff --git a/emBODY/eBcode/arch-arm/board/amc/bsp/embot_hw_bsp_amc.cpp b/emBODY/eBcode/arch-arm/board/amc/bsp/embot_hw_bsp_amc.cpp index 7db0995a67..1ebb34ee8f 100644 --- a/emBODY/eBcode/arch-arm/board/amc/bsp/embot_hw_bsp_amc.cpp +++ b/emBODY/eBcode/arch-arm/board/amc/bsp/embot_hw_bsp_amc.cpp @@ -1377,6 +1377,177 @@ namespace embot { namespace hw { namespace timer { } }}} +#else + +namespace embot { namespace hw { namespace timer { + #if defined(STM32HAL_BOARD_AMC) + // sadly we cannot use constexpr because of the reinterpret_cast<> inside TIM6 etc. + TIM_HandleTypeDef htim13; + static const PROP tim13p = { .TIMx = TIM13, .handle = &htim13, .clock = embot::hw::CLOCK::none, .speed = 200 * 1000000, .isonepulse = false, .mastermode = true }; + + TIM_HandleTypeDef htim15; + static const PROP tim15p = { .TIMx = TIM15, .handle = &htim15, .clock = embot::hw::CLOCK::none, .speed = 200 * 1000000, .isonepulse = false, .mastermode = true }; + + TIM_HandleTypeDef htim16; + static const PROP tim16p = { .TIMx = TIM16, .handle = &htim16, .clock = embot::hw::CLOCK::none, .speed = 200 * 1000000, .isonepulse = false, .mastermode = true }; + + constexpr BSP thebsp { + // maskofsupported + mask::pos2mask(TIMER::thirteen) | mask::pos2mask(TIMER::fifteen) | mask::pos2mask(TIMER::sixteen), + // properties + {{ + nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, // from 1 to 8 + nullptr, nullptr, nullptr, nullptr, &tim13p, nullptr, &tim15p, &tim16p // from 9 to 16 + }} + }; + + void BSP::init(embot::hw::TIMER h) const {} + #else + #error embot::hw::timer::thebsp must be defined + #endif + + const BSP& getBSP() + { + return thebsp; + } +}}} + +// in here it is implemented in the way the good old hal2 was doing: the handler directly manages the callback +// instead the stm hal make a lot of calls before actually calling the callback code, hence it is slower. + +#include "embot_hw_timer.h" + +void manageInterrupt(embot::hw::TIMER t, TIM_HandleTypeDef *htim) +{ + if(__HAL_TIM_GET_FLAG(htim, TIM_FLAG_UPDATE) != RESET) + { + if(__HAL_TIM_GET_IT_SOURCE(htim, TIM_IT_UPDATE) !=RESET) + { + __HAL_TIM_CLEAR_IT(htim, TIM_IT_UPDATE); + embot::hw::timer::execute(t); + } + } +} + + +extern "C" { + void TIM8_UP_TIM13_IRQHandler(void) + { + #warning TODO: cambiare il modo in cui si chiama la callback. usare le callback di stm32 + manageInterrupt(embot::hw::TIMER::thirteen, &embot::hw::timer::htim13); + } + + void TIM15_IRQHandler(void) + { + manageInterrupt(embot::hw::TIMER::fifteen, &embot::hw::timer::htim15); + } + + void TIM16_IRQHandler(void) + { + manageInterrupt(embot::hw::TIMER::sixteen, &embot::hw::timer::htim16); + } +} + + +extern "C" +{ + void HAL_TIM_Base_MspInit(TIM_HandleTypeDef* tim_baseHandle) + { + if(tim_baseHandle->Instance==TIM13) + { + /* USER CODE BEGIN TIM13_MspInit 0 */ + + /* USER CODE END TIM13_MspInit 0 */ + /* TIM13 clock enable */ + __HAL_RCC_TIM13_CLK_ENABLE(); + + /* TIM13 interrupt Init */ + HAL_NVIC_SetPriority(TIM8_UP_TIM13_IRQn, 0, 0); + HAL_NVIC_EnableIRQ(TIM8_UP_TIM13_IRQn); + /* USER CODE BEGIN TIM13_MspInit 1 */ + + /* USER CODE END TIM13_MspInit 1 */ + } + else if(tim_baseHandle->Instance==TIM15) + { + /* USER CODE BEGIN TIM15_MspInit 0 */ + + /* USER CODE END TIM15_MspInit 0 */ + /* TIM15 clock enable */ + __HAL_RCC_TIM15_CLK_ENABLE(); + + /* TIM15 interrupt Init */ + HAL_NVIC_SetPriority(TIM15_IRQn, 0, 0); + HAL_NVIC_EnableIRQ(TIM15_IRQn); + /* USER CODE BEGIN TIM15_MspInit 1 */ + + /* USER CODE END TIM15_MspInit 1 */ + } + else if(tim_baseHandle->Instance==TIM16) + { + /* USER CODE BEGIN TIM16_MspInit 0 */ + + /* USER CODE END TIM16_MspInit 0 */ + /* TIM15 clock enable */ + __HAL_RCC_TIM16_CLK_ENABLE(); + + /* TIM16 interrupt Init */ + HAL_NVIC_SetPriority(TIM16_IRQn, 0, 0); + HAL_NVIC_EnableIRQ(TIM16_IRQn); + /* USER CODE BEGIN TIM15_MspInit 1 */ + + /* USER CODE END TIM15_MspInit 1 */ + } + } + + void HAL_TIM_Base_MspDeInit(TIM_HandleTypeDef* tim_baseHandle) + { + + if(tim_baseHandle->Instance==TIM13) + { + /* USER CODE BEGIN TIM13_MspDeInit 0 */ + + /* USER CODE END TIM13_MspDeInit 0 */ + /* Peripheral clock disable */ + __HAL_RCC_TIM13_CLK_DISABLE(); + + /* TIM13 interrupt Deinit */ + HAL_NVIC_DisableIRQ(TIM8_UP_TIM13_IRQn); + /* USER CODE BEGIN TIM13_MspDeInit 1 */ + + /* USER CODE END TIM13_MspDeInit 1 */ + } + else if(tim_baseHandle->Instance==TIM15) + { + /* USER CODE BEGIN TIM15_MspDeInit 0 */ + + /* USER CODE END TIM15_MspDeInit 0 */ + /* Peripheral clock disable */ + __HAL_RCC_TIM15_CLK_DISABLE(); + + /* TIM15 interrupt Deinit */ + HAL_NVIC_DisableIRQ(TIM15_IRQn); + /* USER CODE BEGIN TIM15_MspDeInit 1 */ + + /* USER CODE END TIM15_MspDeInit 1 */ + } + else if(tim_baseHandle->Instance==TIM16) + { + /* USER CODE BEGIN TIM16_MspDeInit 0 */ + + /* USER CODE END TIM16_MspDeInit 0 */ + /* Peripheral clock disable */ + __HAL_RCC_TIM16_CLK_DISABLE(); + + /* TIM16 interrupt Deinit */ + HAL_NVIC_DisableIRQ(TIM16_IRQn); + /* USER CODE BEGIN TIM16_MspDeInit 1 */ + + /* USER CODE END TIM16_MspDeInit 1 */ + } + } +} + #endif // timer // - end-of-file (leave a blank line after)---------------------------------------------------------------------------- diff --git a/emBODY/eBcode/arch-arm/board/amc/examples/embot-os-hw/src/main-embot-os-hw.cpp b/emBODY/eBcode/arch-arm/board/amc/examples/embot-os-hw/src/main-embot-os-hw.cpp index 6dd6f7b3cc..35964751b5 100644 --- a/emBODY/eBcode/arch-arm/board/amc/examples/embot-os-hw/src/main-embot-os-hw.cpp +++ b/emBODY/eBcode/arch-arm/board/amc/examples/embot-os-hw/src/main-embot-os-hw.cpp @@ -16,6 +16,7 @@ #include "embot_hw_led.h" #include "embot_hw_sys.h" #include "embot_hw_can.h" +#include "embot_hw_timer.h" #include "embot_os_theScheduler.h" @@ -48,6 +49,8 @@ constexpr embot::core::relTime tickperiod = 1000*embot::core::time1millisec; //#define TEST_EMBOT_HW_CAN_gateway_CAN2toCAN1 //#define TEST_EMBOT_HW_CAN_gateway_CAN1toCAN2 +//# define TEST_EMBOT_HW_TIMER + void test_embot_hw_init(); void test_embot_hw_tick(); #endif @@ -302,7 +305,7 @@ void tMAIN(void *p) t->run(); } - +// entry point (first running thread) void initSystem(embot::os::Thread *t, void* initparam) { volatile uint32_t cpufreq = embot::hw::sys::clock(embot::hw::CLOCK::syscore); @@ -313,6 +316,7 @@ void initSystem(embot::os::Thread *t, void* initparam) embot::core::print("INIT: creating the system services: timer manager + callback manager"); + // start the services with default params embot::os::theTimerManager::getInstance().start({}); embot::os::theCallbackManager::getInstance().start({}); @@ -454,8 +458,91 @@ void done3(void* p) embot::core::print("SPI::three cbk called"); } +// --------------------------------------------------------------------------------------------- + +static std::uint8_t on = 0; +constexpr embot::os::Event evtTIM_HW = embot::core::binary::mask::pos2mask(0); +void timer_cbk(void* p) +{ + embot::os::EventThread* thr = reinterpret_cast(p); + thr->setEvent(evtTIM_HW); +} + +void toggleLED(void*) +{ + if(0 == on) + { + embot::hw::led::off(embot::hw::LED::five); + on = 1; + } + else + { + embot::hw::led::on(embot::hw::LED::five); + on = 0; + } +// embot::hw::chip::testof_AS5045(); +} + +void tim_hw_onevent(embot::os::Thread *t, embot::os::EventMask eventmask, void *param) +{ + if( eventmask == evtTIM_HW) + { + toggleLED(nullptr); + } +} + + +void tTIMTEST(void *p) +{ + embot::os::Thread* t = reinterpret_cast(p); + t->run(); +} + void test_embot_hw_init() { +#if defined(TEST_EMBOT_HW_TIMER) + + embot::hw::led::init(embot::hw::LED::five); + + // 1. Configure and create a thread that will toggle the LED when the event evtTIM_HW is set. + embot::core::print("Creating a thread that manages the timer callback."); + + embot::os::EventThread::Config configEV { + 6*1024, + embot::os::Priority::high40, + nullptr, + nullptr, + embot::core::reltimeWaitForever, + tim_hw_onevent, + "timThreadEvt" + }; + + embot::os::EventThread *thr {nullptr}; + thr = new embot::os::EventThread; + thr->start(configEV, tTIMTEST); + + // 2. Create and initialize the timer with the callback defined above + embot::core::Callback tim_hw_cbk { timer_cbk, thr }; + + constexpr embot::core::relTime period {embot::core::time1millisec * 1}; +// constexpr embot::core::relTime period {embot::core::time1microsec * 50}; +// constexpr embot::core::relTime period {embot::core::time1millisec * 1000}; + + embot::hw::timer::Config timerConfig { + period, + embot::hw::timer::Mode::periodic, + tim_hw_cbk, + }; + + constexpr embot::hw::TIMER timer2test {embot::hw::TIMER::thirteen}; + //constexpr embot::hw::TIMER timer2test {embot::hw::TIMER::fifteen}; + //constexpr embot::hw::TIMER timer2test {embot::hw::TIMER::sixteen}; + embot::hw::timer::init(timer2test, timerConfig); + + // 3. Start the timer + embot::hw::timer::start(timer2test); +#endif + #if defined(TEST_EMBOT_HW_FLASH) diff --git a/emBODY/eBcode/arch-arm/embot/hw/embot_hw_timer.cpp b/emBODY/eBcode/arch-arm/embot/hw/embot_hw_timer.cpp index cf31547bf8..26723926d3 100644 --- a/emBODY/eBcode/arch-arm/embot/hw/embot_hw_timer.cpp +++ b/emBODY/eBcode/arch-arm/embot/hw/embot_hw_timer.cpp @@ -309,7 +309,7 @@ namespace embot { namespace hw { namespace timer { #else #if defined(STM32HAL_STM32H7) -#error pls verify embot::hw::timer for STM32H7 +//#error pls verify embot::hw::timer for STM32H7 #endif @@ -351,7 +351,7 @@ namespace embot { namespace hw { namespace timer { { // for some timers referencespeed could also be HAL_RCC_GetSysClockFreq() or HAL_RCC_GetPCLK1Freq() or HAL_RCC_GetPCLK2Freq() // i embed teh choice into that into embot::hw::sys::clock() - uint32_t referencespeed = embot::hw::sys::clock(stm32data->clock); + uint32_t referencespeed = (embot::hw::CLOCK::none == stm32data->clock) ? stm32data->speed : embot::hw::sys::clock(stm32data->clock); effectivetime = time; @@ -429,7 +429,8 @@ namespace embot { namespace hw { namespace timer { #if defined(STM32HAL_STM32L4) && (STM32HAL_DRIVER_VERSION >= 0x183) phandletimx->Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE; #elif defined(STM32HAL_STM32H7) - #error verify it + #warning TODO: verify it + phandletimx->Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE; #endif diff --git a/emBODY/eBcode/arch-arm/embot/hw/embot_hw_timer_bsp.h b/emBODY/eBcode/arch-arm/embot/hw/embot_hw_timer_bsp.h index f99e3b870e..e4a0e18159 100644 --- a/emBODY/eBcode/arch-arm/embot/hw/embot_hw_timer_bsp.h +++ b/emBODY/eBcode/arch-arm/embot/hw/embot_hw_timer_bsp.h @@ -30,7 +30,8 @@ namespace embot { namespace hw { namespace timer { { TIM_t* TIMx {nullptr}; TIM_Handle* handle {nullptr}; - embot::hw::CLOCK clock {embot::hw::CLOCK::none}; // the clock used by the timer + embot::hw::CLOCK clock {embot::hw::CLOCK::none}; // the clock used by the timer + uint32_t speed {0}; bool isonepulse {false}; bool mastermode {false}; }; diff --git a/emBODY/eBcode/arch-arm/libs/lowlevel/stm32hal/proj/stm32hal.h7.uvoptx b/emBODY/eBcode/arch-arm/libs/lowlevel/stm32hal/proj/stm32hal.h7.uvoptx index e2528988db..7da7a70740 100644 --- a/emBODY/eBcode/arch-arm/libs/lowlevel/stm32hal/proj/stm32hal.h7.uvoptx +++ b/emBODY/eBcode/arch-arm/libs/lowlevel/stm32hal/proj/stm32hal.h7.uvoptx @@ -4641,7 +4641,7 @@ board-amc-v1A0-eth - 1 + 0 0 0 0 diff --git a/emBODY/eBcode/arch-arm/libs/lowlevel/stm32hal/proj/stm32hal.h7.uvprojx b/emBODY/eBcode/arch-arm/libs/lowlevel/stm32hal/proj/stm32hal.h7.uvprojx index fd47fe586e..04f1a03540 100644 --- a/emBODY/eBcode/arch-arm/libs/lowlevel/stm32hal/proj/stm32hal.h7.uvprojx +++ b/emBODY/eBcode/arch-arm/libs/lowlevel/stm32hal/proj/stm32hal.h7.uvprojx @@ -16,7 +16,7 @@ STM32H743ZITx STMicroelectronics - Keil.STM32H7xx_DFP.2.8.0 + Keil.STM32H7xx_DFP.3.0.0 http://www.keil.com/pack/ IRAM(0x20000000,0x00020000) IRAM2(0x24000000,0x00080000) IROM(0x08000000,0x00100000) IROM2(0x08100000,0x00100000) XRAM(0x30000000,0x00048000) XRAM2(0x38000000,0x00010000) CPUTYPE("Cortex-M7") FPU3(DFPU) CLOCK(12000000) ELITTLE @@ -186,6 +186,7 @@ 3 0 0 + 0 1 1 8 @@ -2439,7 +2440,7 @@ STM32H743ZITx STMicroelectronics - Keil.STM32H7xx_DFP.2.8.0 + Keil.STM32H7xx_DFP.3.0.0 http://www.keil.com/pack/ IRAM(0x20000000,0x00020000) IRAM2(0x24000000,0x00080000) IROM(0x08000000,0x00100000) IROM2(0x08100000,0x00100000) XRAM(0x30000000,0x00048000) XRAM2(0x38000000,0x00010000) CPUTYPE("Cortex-M7") FPU3(DFPU) CLOCK(12000000) ELITTLE @@ -2609,6 +2610,7 @@ 3 0 0 + 0 1 1 8 @@ -4964,7 +4966,7 @@ STM32H745XIHx:CM7 STMicroelectronics - Keil.STM32H7xx_DFP.2.8.0 + Keil.STM32H7xx_DFP.3.0.0 http://www.keil.com/pack/ IRAM(0x38000000,0x00010000) IRAM2(0x24000000,0x00080000) IROM(0x08000000,0x00100000) CPUTYPE("Cortex-M7") FPU3(DFPU) CLOCK(12000000) ELITTLE @@ -5134,6 +5136,7 @@ 3 0 0 + 0 1 0 8 @@ -7489,7 +7492,7 @@ STM32H745XIHx:CM7 STMicroelectronics - Keil.STM32H7xx_DFP.2.8.0 + Keil.STM32H7xx_DFP.3.0.0 http://www.keil.com/pack/ IRAM(0x38000000,0x00010000) IRAM2(0x24000000,0x00080000) IROM(0x08000000,0x00100000) CPUTYPE("Cortex-M7") FPU3(DFPU) CLOCK(12000000) ELITTLE @@ -7659,6 +7662,7 @@ 3 0 0 + 0 1 0 8 @@ -10077,13 +10081,13 @@ amc-v1A0 0x4 ARM-ADS - 6160000::V6.16::ARMCLANG + 6180000::V6.18::ARMCLANG 1 STM32H745IIKx:CM7 STMicroelectronics - Keil.STM32H7xx_DFP.2.8.0 + Keil.STM32H7xx_DFP.3.0.0 http://www.keil.com/pack/ IRAM(0x38000000,0x00010000) IRAM2(0x24000000,0x00080000) IROM(0x08000000,0x00100000) XRAM(0x20000000,0x00020000) CPUTYPE("Cortex-M7") FPU3(DFPU) CLOCK(12000000) ELITTLE @@ -10253,6 +10257,7 @@ 3 0 0 + 0 1 0 8 @@ -10380,7 +10385,7 @@ 1 - 6 + 2 0 0 1 diff --git a/emBODY/eBcode/arch-arm/libs/lowlevel/stm32hal/src/board/amc/v1A0/inc/res_mgr_conf.h b/emBODY/eBcode/arch-arm/libs/lowlevel/stm32hal/src/board/amc/v1A0/inc/res_mgr_conf.h index 22399038c5..e6fb502f4f 100644 --- a/emBODY/eBcode/arch-arm/libs/lowlevel/stm32hal/src/board/amc/v1A0/inc/res_mgr_conf.h +++ b/emBODY/eBcode/arch-arm/libs/lowlevel/stm32hal/src/board/amc/v1A0/inc/res_mgr_conf.h @@ -97,6 +97,8 @@ enum RESMGR_ID_SPI6, RESMGR_ID_SYSCFG, RESMGR_ID_TIM1, + RESMGR_ID_TIM13, + RESMGR_ID_TIM15, RESMGR_ID_TIM16, RESMGR_ID_TIM17, RESMGR_ID_TIM4, @@ -176,7 +178,9 @@ static const uint8_t Default_ResTbl[RESMGR_ENTRY_NBR] = { RES_DEFAULT_ASSIGN_CPU1, /* RESMGR_ID_SPI6 */ RES_DEFAULT_ASSIGN_CPU1, /* RESMGR_ID_SYSCFG */ RES_DEFAULT_ASSIGN_CPU2, /* RESMGR_ID_TIM1 */ - RES_DEFAULT_ASSIGN_CPU2, /* RESMGR_ID_TIM16 */ + RES_DEFAULT_ASSIGN_CPU1, /* RESMGR_ID_TIM13 */ + RES_DEFAULT_ASSIGN_CPU1, /* RESMGR_ID_TIM15 */ + RES_DEFAULT_ASSIGN_CPU1, /* RESMGR_ID_TIM16 */ RES_DEFAULT_ASSIGN_CPU1, /* RESMGR_ID_TIM17 */ RES_DEFAULT_ASSIGN_CPU2, /* RESMGR_ID_TIM4 */ RES_DEFAULT_ASSIGN_CPU2, /* RESMGR_ID_TIM5 */ diff --git a/emBODY/eBcode/arch-arm/libs/lowlevel/stm32hal/src/board/amc/v1A0/src/tim.c b/emBODY/eBcode/arch-arm/libs/lowlevel/stm32hal/src/board/amc/v1A0/src/tim.c index 9cec16055b..8da5343907 100644 --- a/emBODY/eBcode/arch-arm/libs/lowlevel/stm32hal/src/board/amc/v1A0/src/tim.c +++ b/emBODY/eBcode/arch-arm/libs/lowlevel/stm32hal/src/board/amc/v1A0/src/tim.c @@ -88,66 +88,66 @@ void MX_TIM17_Init(void) } -void HAL_TIM_Base_MspInit(TIM_HandleTypeDef* tim_baseHandle) -{ - - if(tim_baseHandle->Instance==TIM6) - { - /* USER CODE BEGIN TIM6_MspInit 0 */ - - /* USER CODE END TIM6_MspInit 0 */ - /* TIM6 clock enable */ - __HAL_RCC_TIM6_CLK_ENABLE(); - /* USER CODE BEGIN TIM6_MspInit 1 */ - - /* USER CODE END TIM6_MspInit 1 */ - } - else if(tim_baseHandle->Instance==TIM17) - { - /* USER CODE BEGIN TIM17_MspInit 0 */ - - /* USER CODE END TIM17_MspInit 0 */ - /* TIM17 clock enable */ - __HAL_RCC_TIM17_CLK_ENABLE(); - - /* TIM17 interrupt Init */ - HAL_NVIC_SetPriority(TIM17_IRQn, 15, 0); - HAL_NVIC_EnableIRQ(TIM17_IRQn); - /* USER CODE BEGIN TIM17_MspInit 1 */ - - /* USER CODE END TIM17_MspInit 1 */ - } -} - -void HAL_TIM_Base_MspDeInit(TIM_HandleTypeDef* tim_baseHandle) -{ - - if(tim_baseHandle->Instance==TIM6) - { - /* USER CODE BEGIN TIM6_MspDeInit 0 */ - - /* USER CODE END TIM6_MspDeInit 0 */ - /* Peripheral clock disable */ - __HAL_RCC_TIM6_CLK_DISABLE(); - /* USER CODE BEGIN TIM6_MspDeInit 1 */ - - /* USER CODE END TIM6_MspDeInit 1 */ - } - else if(tim_baseHandle->Instance==TIM17) - { - /* USER CODE BEGIN TIM17_MspDeInit 0 */ - - /* USER CODE END TIM17_MspDeInit 0 */ - /* Peripheral clock disable */ - __HAL_RCC_TIM17_CLK_DISABLE(); - - /* TIM17 interrupt Deinit */ - HAL_NVIC_DisableIRQ(TIM17_IRQn); - /* USER CODE BEGIN TIM17_MspDeInit 1 */ - - /* USER CODE END TIM17_MspDeInit 1 */ - } -} +//void HAL_TIM_Base_MspInit(TIM_HandleTypeDef* tim_baseHandle) +//{ + +// if(tim_baseHandle->Instance==TIM6) +// { +// /* USER CODE BEGIN TIM6_MspInit 0 */ + +// /* USER CODE END TIM6_MspInit 0 */ +// /* TIM6 clock enable */ +// __HAL_RCC_TIM6_CLK_ENABLE(); +// /* USER CODE BEGIN TIM6_MspInit 1 */ + +// /* USER CODE END TIM6_MspInit 1 */ +// } +// else if(tim_baseHandle->Instance==TIM17) +// { +// /* USER CODE BEGIN TIM17_MspInit 0 */ + +// /* USER CODE END TIM17_MspInit 0 */ +// /* TIM17 clock enable */ +// __HAL_RCC_TIM17_CLK_ENABLE(); + +// /* TIM17 interrupt Init */ +// HAL_NVIC_SetPriority(TIM17_IRQn, 15, 0); +// HAL_NVIC_EnableIRQ(TIM17_IRQn); +// /* USER CODE BEGIN TIM17_MspInit 1 */ + +// /* USER CODE END TIM17_MspInit 1 */ +// } +//} + +//void HAL_TIM_Base_MspDeInit(TIM_HandleTypeDef* tim_baseHandle) +//{ + +// if(tim_baseHandle->Instance==TIM6) +// { +// /* USER CODE BEGIN TIM6_MspDeInit 0 */ + +// /* USER CODE END TIM6_MspDeInit 0 */ +// /* Peripheral clock disable */ +// __HAL_RCC_TIM6_CLK_DISABLE(); +// /* USER CODE BEGIN TIM6_MspDeInit 1 */ + +// /* USER CODE END TIM6_MspDeInit 1 */ +// } +// else if(tim_baseHandle->Instance==TIM17) +// { +// /* USER CODE BEGIN TIM17_MspDeInit 0 */ + +// /* USER CODE END TIM17_MspDeInit 0 */ +// /* Peripheral clock disable */ +// __HAL_RCC_TIM17_CLK_DISABLE(); + +// /* TIM17 interrupt Deinit */ +// HAL_NVIC_DisableIRQ(TIM17_IRQn); +// /* USER CODE BEGIN TIM17_MspDeInit 1 */ + +// /* USER CODE END TIM17_MspDeInit 1 */ +// } +//} /* USER CODE BEGIN 1 */