Skip to content

Commit

Permalink
Fix nametag
Browse files Browse the repository at this point in the history
  • Loading branch information
hnzlmnn committed Jun 27, 2024
1 parent 4cea948 commit 36487dc
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 6 deletions.
27 changes: 27 additions & 0 deletions burn_id_manual.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

# Always fail hard
set -e

i="$1"

read -p "Ready to burn $i. Press any key to continue..."

verify=`espefuse.py dump | grep BLOCK2 | cut -c 56-60 | python -c 'import sys,struct; print(struct.unpack("<H", bytes.fromhex(sys.stdin.read()))[0])'`
if [ "$verify" != "0" ]; then
read -p "Badge already contains an ID: $verify"
continue
fi

# Write binary
python -c 'import sys, struct; f=open("id.bin", "wb+"); f.write(struct.pack(">H", int(sys.argv[1])) + bytes([0]*30)); f.close()' $i

# Burn fuses
espefuse.py burn_block_data BLOCK2 id.bin --do-not-confirm > /dev/null

# Verify fuses
verify=`espefuse.py dump | grep BLOCK2 | cut -c 56-60 | python -c 'import sys,struct; print(struct.unpack("<H", bytes.fromhex(sys.stdin.read()))[0])'`
if [ "$i" != $verify ]; then
echo "Wrote $i, read $verify"
exit
fi
2 changes: 1 addition & 1 deletion components/spi-st77xx
Submodule spi-st77xx updated 2 files
+2 −0 include/st77xx.h
+9 −0 st77xx.c
7 changes: 2 additions & 5 deletions main/nametag.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,8 @@ static void place_in_sleep(xQueueHandle button_queue) {
fflush(stdout);
fflush(stderr);
vTaskDelay(pdMS_TO_TICKS(100));
#ifdef TR23
gpio_hold_en(GPIO_LCD_BL);
ili9341_power_en(get_ili9341());
#endif
// TODO: Power enable on sleep

st77xx_power_en(get_st77xx());
gpio_deep_sleep_hold_en();
vTaskDelay(pdMS_TO_TICKS(100));
esp_deep_sleep_start();
Expand Down
Binary file modified resources/boot0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/boot1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/boot2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/boot3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/boot4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/boot5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/boot6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 36487dc

Please sign in to comment.