Skip to content

Commit

Permalink
issue cnlohr#212 fix
Browse files Browse the repository at this point in the history
  • Loading branch information
pio committed Jul 25, 2023
1 parent 25c2770 commit 207010b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
6 changes: 5 additions & 1 deletion examples/MCOtest/MCOtest.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ int main()
// PC4 is T1CH4, 50MHz Output PP CNF = 10: Mux PP, MODE = 11: Out 50MHz
GPIOC->CFGLR &= ~(GPIO_CFGLR_MODE4 | GPIO_CFGLR_CNF4);
GPIOC->CFGLR |= GPIO_CFGLR_CNF4_1 | GPIO_CFGLR_MODE4_0 | GPIO_CFGLR_MODE4_1;

// turn the HSE on
RCC->CTLR |= RCC_HSE_ON;
// Wait till HSE is ready
while(!(RCC->CTLR & RCC_HSERDY));

while(1)
{
switch(count)
Expand Down
4 changes: 2 additions & 2 deletions examples/MCOtest/funconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
#define FUNCONF_TINYVECTOR 1
#define CH32V003 1

#define FUNCONF_USE_HSE 1
#define FUNCONF_USE_HSE 0
#define FUNCONF_USE_HSI 1

#endif
#endif // _FUNCONFIG_H

4 changes: 3 additions & 1 deletion extralibs/ch32v003_SPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
#include<stdint.h> //uintN_t support
#include"../ch32v003fun/ch32v003fun.h"


#ifndef APB_CLOCK
#define APB_CLOCK FUNCONF_SYSTEM_CORE_CLOCK
#endif

/*######## library usage and configuration
Expand Down

0 comments on commit 207010b

Please sign in to comment.