Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
marlin-anet-a8
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jonas Leder
marlin-anet-a8
Commits
93dd097b
Commit
93dd097b
authored
6 years ago
by
Tanguy Pruvot
Committed by
Scott Lahteine
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Use E2END, if defined, for STM32F1 (SD) (#13981)
parent
3bf43b6c
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Marlin/src/HAL/HAL_STM32F1/persistent_store_sdcard.cpp
+38
-27
38 additions, 27 deletions
Marlin/src/HAL/HAL_STM32F1/persistent_store_sdcard.cpp
with
38 additions
and
27 deletions
Marlin/src/HAL/HAL_STM32F1/persistent_store_sdcard.cpp
+
38
−
27
View file @
93dd097b
/**
/**
* Marlin 3D Printer Firmware
* Marlin 3D Printer Firmware
*
* Copyright (C) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (C) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
*
*
Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com
*
Based on Sprinter and grbl.
* Copyright (
c
) 201
6 Victor Perez victor_pv@hotmail.co
m
* Copyright (
C
) 201
1 Camiel Gubbels / Erik van der Zal
m
*
*
* This program is free software: you can redistribute it and/or modify
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* it under the terms of the GNU General Public License as published by
...
@@ -33,12 +32,18 @@
...
@@ -33,12 +32,18 @@
#include
"../shared/persistent_store_api.h"
#include
"../shared/persistent_store_api.h"
#include
"../../sd/cardreader.h"
#ifndef E2END
#define E2END 4095
#endif
#define HAL_STM32F1_EEPROM_SIZE (E2END + 1)
#define HAL_STM32F1_EEPROM_SIZE 4096
static
char
HAL_STM32F1_eeprom_content
[
HAL_STM32F1_EEPROM_SIZE
];
char
HAL_STM32F1_eeprom_content
[
HAL_STM32F1_EEPROM_SIZE
];
char
eeprom_filename
[]
=
"eeprom.dat"
;
#if ENABLED(SDSUPPORT)
#include
"../../sd/cardreader.h"
static
const
char
eeprom_filename
[]
=
"eeprom.dat"
;
bool
PersistentStore
::
access_start
()
{
bool
PersistentStore
::
access_start
()
{
if
(
!
card
.
isDetected
())
return
false
;
if
(
!
card
.
isDetected
())
return
false
;
...
@@ -61,6 +66,12 @@ bool PersistentStore::access_finish() {
...
@@ -61,6 +66,12 @@ bool PersistentStore::access_finish() {
return
(
bytes_written
==
HAL_STM32F1_EEPROM_SIZE
);
return
(
bytes_written
==
HAL_STM32F1_EEPROM_SIZE
);
}
}
#else // !SDSUPPORT
#error "Please define SPI_EEPROM (in Configuration.h) or disable EEPROM_SETTINGS."
#endif // !SDSUPPORT
bool
PersistentStore
::
write_data
(
int
&
pos
,
const
uint8_t
*
value
,
const
size_t
size
,
uint16_t
*
crc
)
{
bool
PersistentStore
::
write_data
(
int
&
pos
,
const
uint8_t
*
value
,
const
size_t
size
,
uint16_t
*
crc
)
{
for
(
size_t
i
=
0
;
i
<
size
;
i
++
)
for
(
size_t
i
=
0
;
i
<
size
;
i
++
)
HAL_STM32F1_eeprom_content
[
pos
+
i
]
=
value
[
i
];
HAL_STM32F1_eeprom_content
[
pos
+
i
]
=
value
[
i
];
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment