Allow BOOT_BOOT0_COMCONSOLE_SPEED to be derived from BOOT_COMCONSOLE_SPEED

at compile time.
This commit is contained in:
ru 2005-04-25 17:41:35 +00:00
parent 15f9876206
commit ab3a904906

View File

@ -21,11 +21,34 @@ BOOT_BOOT0_TICKS?= 0xb6
# unless you are glutton for punishment.
BOOT_BOOT0_ORG?= 0x600
# Comm settings for boot0sio. 0xE3 => 9600 8-N-1
# XXX: We should create a build-tool or something to convert BOOT_CONSOLE_SPEED
# and BOOT_COMCONSOLE_PORT into the correct values to define on the build
# command line
BOOT_BOOT0_COMCONSOLE_SPEED?= 0xE3
# Comm settings for boot0sio.
# Bit(s) Description
# 7-5 data rate (110,150,300,600,1200,2400,4800,9600 bps)
# 4-3 parity (00 or 10 = none, 01 = odd, 11 = even)
# 2 stop bits (set = 2, clear = 1)
# 1-0 data bits (00 = 5, 01 = 6, 10 = 7, 11 = 8)
.if !defined(BOOT_BOOT0_COMCONSOLE_SPEED)
BOOT_COMCONSOLE_SPEED?= 9600
.if ${BOOT_COMCONSOLE_SPEED} == 9600
BOOT_BOOT0_COMCONSOLE_SPEED= "7 << 5 + 3"
.elif ${BOOT_COMCONSOLE_SPEED} == 4800
BOOT_BOOT0_COMCONSOLE_SPEED= "6 << 5 + 3"
.elif ${BOOT_COMCONSOLE_SPEED} == 2400
BOOT_BOOT0_COMCONSOLE_SPEED= "5 << 5 + 3"
.elif ${BOOT_COMCONSOLE_SPEED} == 1200
BOOT_BOOT0_COMCONSOLE_SPEED= "4 << 5 + 3"
.elif ${BOOT_COMCONSOLE_SPEED} == 600
BOOT_BOOT0_COMCONSOLE_SPEED= "3 << 5 + 3"
.elif ${BOOT_COMCONSOLE_SPEED} == 300
BOOT_BOOT0_COMCONSOLE_SPEED= "2 << 5 + 3"
.elif ${BOOT_COMCONSOLE_SPEED} == 150
BOOT_BOOT0_COMCONSOLE_SPEED= "1 << 5 + 3"
.elif ${BOOT_COMCONSOLE_SPEED} == 110
BOOT_BOOT0_COMCONSOLE_SPEED= "0 << 5 + 3"
.else
BOOT_BOOT0_COMCONSOLE_SPEED= "7 << 5 + 3"
.endif
.endif
CFLAGS+=-DFLAGS=${BOOT_BOOT0_FLAGS} \
-DTICKS=${BOOT_BOOT0_TICKS} \