Added _putchar so printf can work.

This commit is contained in:
Dual Tachyon 2023-08-14 12:12:46 +01:00
parent 6786715e03
commit 065070dada
3 changed files with 17 additions and 0 deletions

View File

@ -17,4 +17,7 @@
#include "aircopy.h"
AIRCOPY_State_t gAircopyState;
uint16_t gAirCopyBlockNumber;
uint16_t gErrorsDuringAirCopy;
uint8_t gAirCopyIsSendMode;

View File

@ -17,6 +17,8 @@
#ifndef AIRCOPY_H
#define AIRCOPY_H
#include <stdint.h>
enum AIRCOPY_State_t {
AIRCOPY_READY = 0U,
AIRCOPY_TRANSFER = 1U,
@ -26,6 +28,9 @@ enum AIRCOPY_State_t {
typedef enum AIRCOPY_State_t AIRCOPY_State_t;
extern AIRCOPY_State_t gAircopyState;
extern uint16_t gAirCopyBlockNumber;
extern uint16_t gErrorsDuringAirCopy;
extern uint8_t gAirCopyIsSendMode;
#endif

9
main.c
View File

@ -35,6 +35,7 @@
#include "driver/system.h"
#include "driver/systick.h"
#include "driver/uart.h"
#include "external/printf/printf.h"
#include "functions.h"
#include "gui.h"
#include "helper.h"
@ -109,6 +110,11 @@ static void Console(void)
}
}
void _putchar(char c)
{
UART_Send((uint8_t *)&c, 1);
}
void Main(void)
{
uint8_t i;
@ -193,7 +199,10 @@ void Main(void)
FLASHLIGHT_Init();
FLASHLIGHT_TurnOn();
uint32_t Test = 0;
while (1) {
printf("printf test %d\r\n", Test++);
Console();
SYSTEM_DelayMs(200);