增加了uart输出的条件编译

This commit is contained in:
fslongjin
2022-04-15 15:28:00 +08:00
parent 22359344e4
commit 0e8bf69d65
4 changed files with 21 additions and 6 deletions

View File

@ -29,7 +29,7 @@ int printk_init(const int char_size_x, const int char_size_y)
{
struct multiboot_tag_framebuffer_info_t info;
int reserved;
multiboot2_iter(multiboot2_get_Framebuffer_info, &info, &reserved);
pos.width = info.framebuffer_width;
@ -112,16 +112,20 @@ void auto_newline()
* @brief 超过每行最大字符数,自动换行
*
*/
if (pos.x > pos.max_x)
{
uart_send(COM1, '\n');
#ifdef DEBUG
uart_send(COM1, '\n');
#endif
pos.x = 0;
++pos.y;
}
if (pos.y > pos.max_y)
{
#ifdef DEBUG
uart_send(COM1, '\n');
#endif
pos.y = pos.max_y;
int lines_to_scroll = 1;
scroll(true, lines_to_scroll * pos.char_size_y, false);
@ -630,8 +634,10 @@ static void putchar(uint *fb, int Xsize, int x, int y, unsigned int FRcolor, uns
* @param BKcolor 背景颜色
* @param font 字符的bitmap
*/
// 输出到串口
#ifdef DEBUG
uart_send(COM1, font);
#endif
unsigned char *font_ptr = font_ascii[font];
unsigned int *addr;