Merge pull request #28 from nazarewk/master

Sync fixes from a fork
This commit is contained in:
Trevor Joynson
2023-11-14 19:04:52 -08:00
committed by GitHub
2 changed files with 7 additions and 6 deletions

View File

@@ -1,5 +1,5 @@
SOURCES := $(wildcard [0-9]*x[0-9]*.S)
SOURCES := $(filter-out edid.S, $(wildcard *.S))
BIN := $(patsubst %.S, %.bin, $(SOURCES))
@@ -16,7 +16,7 @@ clean:
cc -c -DCRC="0x00" -o $@ $^
%.bin.nocrc: %.o
objcopy -Obinary $^ $@
objcopy -j .data -Obinary $^ $@
%.crc: %.bin.nocrc
cat $^ | edid-decode \
@@ -26,7 +26,7 @@ clean:
cc -c -DCRC="$$(cat $*.crc)" -o $@ $*.S
%.bin: %.p
objcopy -Obinary $^ $@
objcopy -j .data -Obinary $^ $@
%.bin.ihex: %.p
objcopy -Oihex $^ $@

View File

@@ -32,6 +32,7 @@ template-S() {
local name="${1//\"}"
[[ -z "$name" ]] && echo "Could not parse modeline: $@" >&2 && return 1
[[ "${#name}" -gt 12 ]] && echo "Name cannot be longer than 12 characters: $name is ${#name} characters long" >&2 && return 1
local fn="${name}.S"
local -F pixel_clock_mhz=$2
@@ -47,8 +48,8 @@ template-S() {
local arg
for arg in "$@"; do
case "${(L)arg}" in
[-+]hsync) [[ "${arg:1:1}" == "-" ]] || hsync_polarity=1 ;;
[-+]vsync) [[ "${arg:1:1}" == "-" ]] || vsync_polarity=1 ;;
[-+]hsync) [[ "${arg:0:1}" == "-" ]] || hsync_polarity=1 ;;
[-+]vsync) [[ "${arg:0:1}" == "-" ]] || vsync_polarity=1 ;;
ratio=*|xy_ratio=*) ratio="${arg#*=}" ;;
dpi=*) dpi="${arg#*=}" ;;
edid_version=*) edid_version="${arg#*=}" ;;
@@ -60,7 +61,7 @@ template-S() {
case $ratio in
compute)
ratio=$(find-supported-ratio $hdisp $vdisp 'UNKNOWN')
printf 'Computed ratio: %s' $ratio
printf 'Computed ratio: %s\n' $ratio
[[ $ratio != 'UNKNOWN' ]] || return 1
;;
esac