From 3d12b7066d27b591e0283e20ed066bc66e29fbe4 Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Fri, 10 Nov 2023 21:34:40 -0700 Subject: refactor checkpoint: splitting MCU-specific code into arch/$MCU.[ch] Phew, that's a lot of changes! And there's still a lot more to do... --- arch/attiny85.h | 91 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 arch/attiny85.h (limited to 'arch/attiny85.h') diff --git a/arch/attiny85.h b/arch/attiny85.h new file mode 100644 index 0000000..840079c --- /dev/null +++ b/arch/attiny85.h @@ -0,0 +1,91 @@ +// arch/attiny85.h: attiny85 support header +// Copyright (C) 2014-2023 Selene ToyKeeper +// SPDX-License-Identifier: GPL-3.0-or-later +#pragma once + +// fill in missing values from Atmel's headers +#define PROGMEM_SIZE 8192 +#define EEPROM_SIZE 512 + +////////// clock speed / delay stuff ////////// + +// TODO: Use 6.4 MHz instead of 8 MHz? +#define F_CPU 8000000UL +#define BOGOMIPS (F_CPU/4000) +#define DELAY_ZERO_TIME 1020 + +///// clock dividers +// use clock_prescale_set(n) instead; it's safer +//#define CLOCK_DIVIDER_SET(n) {CLKPR = 1<