~toykeeper/flashlight-firmware/fsm

« back to all changes in this revision

Viewing changes to ToyKeeper/spaghetti-monster/fsm-eeprom.c

  • Committer: Selene ToyKeeper
  • Date: 2023-11-04 15:09:10 UTC
  • mfrom: (483.1.175 anduril2)
  • Revision ID: bzr@toykeeper.net-20231104150910-ddd3afw4nhfvof2l
merged anduril2 branch -> fsm, with *years* of changes
(this also means this code is now Anduril 2 instead of Anduril 1)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * fsm-eeprom.c: EEPROM API for SpaghettiMonster.
3
 
 *
4
 
 * Copyright (C) 2017 Selene Scriven
5
 
 *
6
 
 * This program is free software: you can redistribute it and/or modify
7
 
 * it under the terms of the GNU General Public License as published by
8
 
 * the Free Software Foundation, either version 3 of the License, or
9
 
 * (at your option) any later version.
10
 
 *
11
 
 * This program is distributed in the hope that it will be useful,
12
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 
 * GNU General Public License for more details.
15
 
 *
16
 
 * You should have received a copy of the GNU General Public License
17
 
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
18
 
 */
 
1
// fsm-eeprom.c: EEPROM API for SpaghettiMonster.
 
2
// Copyright (C) 2017-2023 Selene ToyKeeper
 
3
// SPDX-License-Identifier: GPL-3.0-or-later
19
4
 
20
 
#ifndef FSM_EEPROM_C
21
 
#define FSM_EEPROM_C
 
5
#pragma once
22
6
 
23
7
#include "fsm-eeprom.h"
24
8
 
30
14
#endif
31
15
 
32
16
uint8_t load_eeprom() {
33
 
    #ifdef LED_ENABLE_PIN
 
17
    #if defined(LED_ENABLE_PIN) || defined(LED2_ENABLE_PIN)
34
18
    delay_4ms(2);  // wait for power to stabilize
35
19
    #endif
36
20
 
48
32
}
49
33
 
50
34
void save_eeprom() {
51
 
    #ifdef LED_ENABLE_PIN
 
35
    #if defined(LED_ENABLE_PIN) || defined(LED2_ENABLE_PIN)
52
36
    delay_4ms(2);  // wait for power to stabilize
53
37
    #endif
54
38
 
70
54
uint8_t * eep_wl_prev_offset;
71
55
 
72
56
uint8_t load_eeprom_wl() {
73
 
    #ifdef LED_ENABLE_PIN
 
57
    #if defined(LED_ENABLE_PIN) || defined(LED2_ENABLE_PIN)
74
58
    delay_4ms(2);  // wait for power to stabilize
75
59
    #endif
76
60
 
99
83
}
100
84
 
101
85
void save_eeprom_wl() {
102
 
    #ifdef LED_ENABLE_PIN
 
86
    #if defined(LED_ENABLE_PIN) || defined(LED2_ENABLE_PIN)
103
87
    delay_4ms(2);  // wait for power to stabilize
104
88
    #endif
105
89
 
126
110
}
127
111
#endif
128
112
 
129
 
 
130
 
#endif