Added import cmake file
This commit is contained in:
@@ -1,6 +1,11 @@
|
||||
# This file should be included in your project to use the picovga library
|
||||
# the PICOVGA_PATH variable should be set to the root of the picovga project directory
|
||||
|
||||
if (DEFINED ENV{PICOVGA_PATH} AND (NOT PICOVGA_PATH))
|
||||
set(PICOVGA_PATH $ENV{PICOVGA_PATH})
|
||||
message("Using PICOVGA_PATH from environment ('${PICOVGA_PATH}')")
|
||||
endif ()
|
||||
|
||||
# The macro add_picovga adds the picovga path references to the specified project.
|
||||
# PICOVGA_PATH must be set to the root of the picovga project directory
|
||||
macro(add_picovga project)
|
||||
|
||||
28
picovga_import.cmake
Normal file
28
picovga_import.cmake
Normal file
@@ -0,0 +1,28 @@
|
||||
# This is a copy of <PICOVGA_PATH>/picovga_import.cmake
|
||||
|
||||
# This can be dropped into an external project to help locate the PicoVGA SDK
|
||||
# It should be include()ed prior to project()
|
||||
|
||||
if (DEFINED ENV{PICOVGA_PATH} AND (NOT PICOVGA_PATH))
|
||||
set(PICOVGA_PATH $ENV{PICOVGA_PATH})
|
||||
message("Using PICOVGA_PATH from environment ('${PICOVGA_PATH}')")
|
||||
endif ()
|
||||
|
||||
set(PICOVGA_PATH "${PICOVGA_PATH}" CACHE PATH "Path to the PicoVGA Library")
|
||||
|
||||
if (NOT PICOVGA_PATH)
|
||||
message(FATAL_ERROR "PicoVGA location was not specified. Please set PICOVGA_PATH.")
|
||||
endif ()
|
||||
|
||||
if (NOT EXISTS ${PICOVGA_PATH})
|
||||
message(FATAL_ERROR "Directory '${PICOVGA_PATH}' not found")
|
||||
endif ()
|
||||
|
||||
set(PICOVGA_CMAKE_FILE ${PICOVGA_PATH}/picovga.cmake)
|
||||
if (NOT EXISTS ${PICOVGA_CMAKE_FILE})
|
||||
message(FATAL_ERROR "Directory '${PICOVGA_PATH}' does not appear to contain the PicoVGA library")
|
||||
endif ()
|
||||
|
||||
set(PICOVGA_PATH ${PICOVGA_PATH} CACHE PATH "Path to the PicoVGA library" FORCE)
|
||||
|
||||
include(${PICOVGA_CMAKE_FILE})
|
||||
@@ -28,6 +28,8 @@
|
||||
|
||||
// compose PC color
|
||||
#define PC_COLOR(bg,fg) (((bg)<<4)|(fg))
|
||||
#define PC_FGCOLOR(color) ((color) & 0b1111) // Added by WV
|
||||
#define PC_BGCOLOR(color) ((color) >> 4) // Added by WV
|
||||
|
||||
// ASCII characters
|
||||
#define CHAR_CR '\r'
|
||||
|
||||
Reference in New Issue
Block a user