Skip to content

Commit

Permalink
Update examples for updated ch32fun framework version
Browse files Browse the repository at this point in the history
  • Loading branch information
maxgerhardt committed Feb 9, 2025
1 parent bbba2dc commit bae5db4
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion examples/blinky-ch32v003fun/src/blink.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "ch32v003fun.h"
#include "ch32fun.h"
#include <stdio.h>

int main()
Expand Down
8 changes: 5 additions & 3 deletions examples/blinky-ch32v003fun/src/funconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@
// #define FUNCONF_USE_DEBUGPRINTF 1
// #define FUNCONF_USE_UARTPRINTF 0
// #define FUNCONF_NULL_PRINTF 0 // Have printf but direct it "nowhere"
// #define FUNCONF_SYSTICK_USE_HCLK 0 // Should systick be at 48 MHz or 6MHz?
// #define FUNCONF_SYSTICK_USE_HCLK 0 // Should systick be at 48 MHz (1) or 6MHz (0) on an '003. Typically set to 0 to divide HCLK by 8.
// #define FUNCONF_TINYVECTOR 0 // If enabled, Does not allow normal interrupts.
// #define FUNCONF_UART_PRINTF_BAUD 115200 // Only used if FUNCONF_USE_UARTPRINTF is set.
// #define FUNCONF_DEBUGPRINTF_TIMEOUT 160000 // Arbitrary time units
// #define FUNCONF_ENABLE_HPE 1 // Enable hardware interrupt stack. Very good on QingKeV4, i.e. x035, v10x, v20x, v30x, but questionable on 003.
// #define FUNCONF_DEBUGPRINTF_TIMEOUT 0x80000 // Arbitrary time units, this is around 120ms.
// #define FUNCONF_ENABLE_HPE 1 // Enable hardware interrupt stack. Very good on QingKeV4, i.e. x035, v10x, v20x, v30x, but questionable on 003.
// // If you are using that, consider using INTERRUPT_DECORATOR as an attribute to your interrupt handlers.
// #define FUNCONF_USE_5V_VDD 0 // Enable this if you plan to use your part at 5V - affects USB and PD configration on the x035.
// #define FUNCONF_DEBUG_HARDFAULT 1 // Log fatal errors with "printf"

#endif
8 changes: 5 additions & 3 deletions examples/ch32v003fun-oled/src/funconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@
// #define FUNCONF_USE_DEBUGPRINTF 1
// #define FUNCONF_USE_UARTPRINTF 0
// #define FUNCONF_NULL_PRINTF 0 // Have printf but direct it "nowhere"
// #define FUNCONF_SYSTICK_USE_HCLK 0 // Should systick be at 48 MHz or 6MHz?
// #define FUNCONF_SYSTICK_USE_HCLK 0 // Should systick be at 48 MHz (1) or 6MHz (0) on an '003. Typically set to 0 to divide HCLK by 8.
// #define FUNCONF_TINYVECTOR 0 // If enabled, Does not allow normal interrupts.
// #define FUNCONF_UART_PRINTF_BAUD 115200 // Only used if FUNCONF_USE_UARTPRINTF is set.
// #define FUNCONF_DEBUGPRINTF_TIMEOUT 160000 // Arbitrary time units
// #define FUNCONF_ENABLE_HPE 1 // Enable hardware interrupt stack. Very good on QingKeV4, i.e. x035, v10x, v20x, v30x, but questionable on 003.
// #define FUNCONF_DEBUGPRINTF_TIMEOUT 0x80000 // Arbitrary time units, this is around 120ms.
// #define FUNCONF_ENABLE_HPE 1 // Enable hardware interrupt stack. Very good on QingKeV4, i.e. x035, v10x, v20x, v30x, but questionable on 003.
// // If you are using that, consider using INTERRUPT_DECORATOR as an attribute to your interrupt handlers.
// #define FUNCONF_USE_5V_VDD 0 // Enable this if you plan to use your part at 5V - affects USB and PD configration on the x035.
// #define FUNCONF_DEBUG_HARDFAULT 1 // Log fatal errors with "printf"

#endif
4 changes: 2 additions & 2 deletions examples/ch32v003fun-oled/src/i2c_oled.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#define SSD1306_128X32
//#define SSD1306_128X64

#include "ch32v003fun.h"
#include "ch32fun.h"
#include <stdio.h>
#include "ssd1306_i2c.h"
#include "ssd1306.h"
Expand Down Expand Up @@ -128,4 +128,4 @@ int main()

printf("Stuck here forever...\n\r");
while(1);
}
}

0 comments on commit bae5db4

Please sign in to comment.