Skip to content

Commit 9430c12

Browse files
authored
Merge pull request #28 from nazarewk/master
Sync fixes from a fork
2 parents 31a6f80 + f7fd645 commit 9430c12

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

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

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

@@ -16,7 +16,7 @@ clean:
1616
cc -c -DCRC="0x00" -o $@ $^
1717

1818
%.bin.nocrc: %.o
19-
objcopy -Obinary $^ $@
19+
objcopy -j .data -Obinary $^ $@
2020

2121
%.crc: %.bin.nocrc
2222
cat $^ | edid-decode \
@@ -26,7 +26,7 @@ clean:
2626
cc -c -DCRC="$$(cat $*.crc)" -o $@ $*.S
2727

2828
%.bin: %.p
29-
objcopy -Obinary $^ $@
29+
objcopy -j .data -Obinary $^ $@
3030

3131
%.bin.ihex: %.p
3232
objcopy -Oihex $^ $@

modeline2edid

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ template-S() {
3232

3333
local name="${1//\"}"
3434
[[ -z "$name" ]] && echo "Could not parse modeline: $@" >&2 && return 1
35+
[[ "${#name}" -gt 12 ]] && echo "Name cannot be longer than 12 characters: $name is ${#name} characters long" >&2 && return 1
3536
local fn="${name}.S"
3637

3738
local -F pixel_clock_mhz=$2
@@ -47,8 +48,8 @@ template-S() {
4748
local arg
4849
for arg in "$@"; do
4950
case "${(L)arg}" in
50-
[-+]hsync) [[ "${arg:1:1}" == "-" ]] || hsync_polarity=1 ;;
51-
[-+]vsync) [[ "${arg:1:1}" == "-" ]] || vsync_polarity=1 ;;
51+
[-+]hsync) [[ "${arg:0:1}" == "-" ]] || hsync_polarity=1 ;;
52+
[-+]vsync) [[ "${arg:0:1}" == "-" ]] || vsync_polarity=1 ;;
5253
ratio=*|xy_ratio=*) ratio="${arg#*=}" ;;
5354
dpi=*) dpi="${arg#*=}" ;;
5455
edid_version=*) edid_version="${arg#*=}" ;;
@@ -60,7 +61,7 @@ template-S() {
6061
case $ratio in
6162
compute)
6263
ratio=$(find-supported-ratio $hdisp $vdisp 'UNKNOWN')
63-
printf 'Computed ratio: %s' $ratio
64+
printf 'Computed ratio: %s\n' $ratio
6465
[[ $ratio != 'UNKNOWN' ]] || return 1
6566
;;
6667
esac

0 commit comments

Comments
 (0)