Skip to content

Commit

Permalink
Merge pull request #28 from nazarewk/master
Browse files Browse the repository at this point in the history
Sync fixes from a fork
  • Loading branch information
akatrevorjay authored Nov 15, 2023
2 parents 31a6f80 + f7fd645 commit 9430c12
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

SOURCES := $(wildcard [0-9]*x[0-9]*.S)
SOURCES := $(filter-out edid.S, $(wildcard *.S))

BIN := $(patsubst %.S, %.bin, $(SOURCES))

Expand All @@ -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 \
Expand All @@ -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 $^ $@
Expand Down
7 changes: 4 additions & 3 deletions modeline2edid
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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#*=}" ;;
Expand All @@ -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
Expand Down

0 comments on commit 9430c12

Please sign in to comment.