harbor run -t openthoughts/tasktrove-exp-rpt-stack-bash-withtests-gpt5mini-v2-stack-bash-withtests-gpt4o-4423harbor download openthoughts/tasktrove-exp-rpt-stack-bash-withtests-gpt5mini-v2-stack-bash-withtests-gpt4o-4423Implement a small AVR firmware project that drives an RGB LED matrix. The goal is to provide C source files that compile cleanly for an ATxmega16A4U MCU and expose a simple GPIO/matrix API used by main. Place your solution under /app/.
What to build
Required files and naming (must exist in /app/)
Expected API (implement these functions in gpio.c and declare them in gpio.h or directly in main.c)
Behavioral expectations (at runtime)
Build/compile requirements (what the verifier will do)
Notes and constraints
Deliverables (in /app/)
Implement the above so that compiling the files for an ATxmega16A4U target succeeds and the produced firmware initializes GPIO and cycles a visible RGB pattern on an attached LED matrix.
The following test script will be used to verify your solution:
#!/bin/bash
# cleanup old files
rm rgb_matrix.elf rgb_matrix.hex
avr-gcc -Os -mmcu=atxmega16a4u -DF_CPU=2000000 -o rgb_matrix.elf main.c gpio.c
if [ $? -ne 0 ]; then exit 1; fi
avr-objcopy -j .text -j .data -O ihex rgb_matrix.elf rgb_matrix.hex
if [ $? -ne 0 ]; then exit 1; fi
# change this back to xmega64A1U for production
avrdude -v -B 1.0 -c jtag3pdi -p ATxmega16A4U -P usb -u -Uflash:w:rgb_matrix.hex