printk.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. //
  2. // Created by longjin on 2022/1/21.
  3. //
  4. #pragma once
  5. #pragma GCC push_options
  6. #pragma GCC optimize("O0")
  7. #define PAD_ZERO 1 // 0填充
  8. #define LEFT 2 // 靠左对齐
  9. #define RIGHT 4 // 靠右对齐
  10. #define PLUS 8 // 在正数前面显示加号
  11. #define SPACE 16
  12. #define SPECIAL 32 // 在八进制数前面显示 '0o',在十六进制数前面显示 '0x' 或 '0X'
  13. #define SMALL 64 // 十进制以上数字显示小写字母
  14. #define SIGN 128 // 显示符号位
  15. #define is_digit(c) ((c) >= '0' && (c) <= '9') // 用来判断是否是数字的宏
  16. // 字体颜色的宏定义
  17. #define WHITE 0x00ffffff // 白
  18. #define BLACK 0x00000000 // 黑
  19. #define RED 0x00ff0000 // 红
  20. #define ORANGE 0x00ff8000 // 橙
  21. #define YELLOW 0x00ffff00 // 黄
  22. #define GREEN 0x0000ff00 // 绿
  23. #define BLUE 0x000000ff // 蓝
  24. #define INDIGO 0x0000ffff // 靛
  25. #define PURPLE 0x008000ff // 紫
  26. // 异常的宏定义
  27. #define EPOS_OVERFLOW 1 // 坐标溢出
  28. #define EFB_MISMATCH 2 // 帧缓冲区与指定的屏幕大小不匹配
  29. #define EUNSUPPORTED 3 // 当前操作暂不被支持
  30. #include "glib.h"
  31. #include <stdarg.h>
  32. #pragma GCC pop_options