mirror of
https://github.com/jankae/LibreVNA.git
synced 2026-04-05 22:45:23 +00:00
embedded code copied from jankae/VNA and adjusted for STM32G4
This commit is contained in:
parent
7af204b349
commit
30d4ebe37b
215 changed files with 186208 additions and 0 deletions
16
Software/VNA_embedded/Application/Drivers/delay.cpp
Normal file
16
Software/VNA_embedded/Application/Drivers/delay.cpp
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
#include "delay.hpp"
|
||||
|
||||
#include "stm.hpp"
|
||||
|
||||
void Delay::ms(uint32_t t) {
|
||||
while(t--) {
|
||||
us(1000);
|
||||
}
|
||||
}
|
||||
void Delay::us(uint32_t t) {
|
||||
TIM1->CNT = 0;
|
||||
TIM1->CR1 |= TIM_CR1_CEN;
|
||||
while (TIM1->CNT < t)
|
||||
;
|
||||
TIM1->CR1 &= ~TIM_CR1_CEN;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue