~toykeeper/flashlight-firmware/fsm

« back to all changes in this revision

Viewing changes to ToyKeeper/tk-attiny.h

  • Committer: Selene ToyKeeper
  • Date: 2023-11-02 17:05:02 UTC
  • mfrom: (483.12.159 multi-channel)
  • mto: This revision was merged to the branch mainline in revision 491.
  • Revision ID: bzr@toykeeper.net-20231102170502-sinkm18qjxlorsxa
merged multi-channel branch with a major refactor and half a year of updates

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#ifndef TK_ATTINY_H
2
 
#define TK_ATTINY_H
3
 
/*
4
 
 * Attiny portability header.
5
 
 * This helps abstract away the differences between various attiny MCUs.
6
 
 *
7
 
 * Copyright (C) 2017 Selene Scriven
8
 
 *
9
 
 * This program is free software: you can redistribute it and/or modify
10
 
 * it under the terms of the GNU General Public License as published by
11
 
 * the Free Software Foundation, either version 3 of the License, or
12
 
 * (at your option) any later version.
13
 
 *
14
 
 * This program is distributed in the hope that it will be useful,
15
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
 
 * GNU General Public License for more details.
18
 
 *
19
 
 * You should have received a copy of the GNU General Public License
20
 
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
21
 
 *
22
 
 */
 
1
// tk-attiny.h: Attiny portability header.
 
2
// Copyright (C) 2014-2023 Selene ToyKeeper
 
3
// SPDX-License-Identifier: GPL-3.0-or-later
 
4
#pragma once
 
5
 
 
6
// This helps abstract away the differences between various attiny MCUs.
23
7
 
24
8
// Choose your MCU here, or in the main .c file, or in the build script
25
9
//#define ATTINY 13
74
58
#elif (ATTINY == 412) || (ATTINY == 416) || (ATTINY == 417) || (ATTINY == 816) || (ATTINY == 817) || (ATTINY == 1616) || (ATTINY == 1617) || (ATTINY == 3216) || (ATTINY == 3217)
75
59
    #define AVRXMEGA3
76
60
    #define F_CPU 10000000UL
77
 
    #define BOGOMIPS (F_CPU/4000)
 
61
    #define BOGOMIPS (F_CPU/4700)
78
62
    #define EEPSIZE 128
79
63
    #define DELAY_ZERO_TIME 1020
80
64
#else
171
155
#error Unable to define MCU macros.
172
156
#endif
173
157
 
174
 
#endif  // TK_ATTINY_H