39 lines
732 B
C
39 lines
732 B
C
#include <ch32fun.h>
|
|
#include <rsa.h>
|
|
|
|
#define LED_PIN PD6
|
|
#define FREQ 2
|
|
#define BLINK_DELAY 1000 / FREQ
|
|
|
|
void exit_blink() {
|
|
for (int i = 0; i < 4; i++) {
|
|
funDigitalWrite(LED_PIN, FUN_HIGH);
|
|
Delay_Ms(50);
|
|
funDigitalWrite(LED_PIN, FUN_LOW);
|
|
Delay_Ms(50);
|
|
}
|
|
|
|
while (1){};
|
|
|
|
funDigitalWrite(LED_PIN, FUN_HIGH);
|
|
}
|
|
|
|
int main() {
|
|
SystemInit();
|
|
|
|
// Enable GPIOs
|
|
funGpioInitAll();
|
|
|
|
funPinMode(LED_PIN, GPIO_Speed_10MHz | GPIO_CNF_OUT_PP);
|
|
|
|
int i = 0;
|
|
while (i < gcd(930, 10)) {
|
|
i++;
|
|
funDigitalWrite(LED_PIN, FUN_HIGH);
|
|
Delay_Ms(BLINK_DELAY);
|
|
funDigitalWrite(LED_PIN, FUN_LOW);
|
|
Delay_Ms(BLINK_DELAY);
|
|
}
|
|
|
|
exit_blink();
|
|
}
|