From 529cf6067d331bbed8231c873eadc9eaebb88b03 Mon Sep 17 00:00:00 2001 From: Savanni D'Gerinel Date: Tue, 19 Jul 2022 21:17:01 -0400 Subject: [PATCH] Set up for display control on atmega32u4 --- display-i2c/main.c | 6 +++--- flake.nix | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/display-i2c/main.c b/display-i2c/main.c index e02ec82..0205d10 100644 --- a/display-i2c/main.c +++ b/display-i2c/main.c @@ -4,9 +4,9 @@ int main(void) { display_t display = { .reg = { - .output = { .ddr = &DDRB, .port = &PORTB, .pin = &PINB, .addr = 3 }, - .shift_clock = { .ddr = &DDRB, .port = &PORTB, .pin = &PINB, .addr = 2 }, - .latch_clock = { .ddr = &DDRB, .port = &PORTB, .pin = &PINB, .addr = 0 }, + .output = { .ddr = &DDRF, .port = &PORTF, .pin = &PINF, .addr = 7 }, + .shift_clock = { .ddr = &DDRF, .port = &PORTF, .pin = &PINF, .addr = 6 }, + .latch_clock = { .ddr = &DDRF, .port = &PORTF, .pin = &PINF, .addr = 5 }, }, }; diff --git a/flake.nix b/flake.nix index 87a3ac3..18c9546 100644 --- a/flake.nix +++ b/flake.nix @@ -285,6 +285,11 @@ ]; }; + packages."x86_64-linux"."display-i2c_" = + let + pkgs = import nixpkgs { system = "x86_64-linux"; }; + avr = pkgs.pkgsCross.avr.buildPackages; + in packages."x86_64-linux"."display-i2c" { gcc = "${avr.gcc}/bin/avr-gcc"; cflags = mcu_cflags atmega32u4; avr = true; }; packages."x86_64-linux"."display-i2c" = { gcc, cflags, avr }: let