Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
Ardupilot
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
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
OpenSource
Ardupilot
Commits
d45328c9
Commit
d45328c9
authored
12 years ago
by
uncrustify
Committed by
Pat Hickey
12 years ago
Browse files
Options
Downloads
Patches
Plain Diff
uncrustify libraries/DataFlash/DataFlash.h
parent
a935bf77
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libraries/DataFlash/DataFlash.h
+71
-70
71 additions, 70 deletions
libraries/DataFlash/DataFlash.h
with
71 additions
and
70 deletions
libraries/DataFlash/DataFlash.h
+
71
−
70
View file @
d45328c9
...
...
@@ -17,76 +17,77 @@
class
DataFlash_Class
{
private:
// DataFlash Log variables...
unsigned
char
df_BufferNum
;
unsigned
char
df_Read_BufferNum
;
uint16_t
df_BufferIdx
;
uint16_t
df_Read_BufferIdx
;
uint16_t
df_PageAdr
;
uint16_t
df_Read_PageAdr
;
unsigned
char
df_Stop_Write
;
uint16_t
df_FileNumber
;
uint16_t
df_FilePage
;
virtual
void
WaitReady
()
=
0
;
virtual
void
BufferWrite
(
unsigned
char
BufferNum
,
uint16_t
IntPageAdr
,
unsigned
char
Data
)
=
0
;
virtual
void
BufferToPage
(
unsigned
char
BufferNum
,
uint16_t
PageAdr
,
unsigned
char
wait
)
=
0
;
virtual
void
PageToBuffer
(
unsigned
char
BufferNum
,
uint16_t
PageAdr
)
=
0
;
virtual
unsigned
char
BufferRead
(
unsigned
char
BufferNum
,
uint16_t
IntPageAdr
)
=
0
;
virtual
void
PageErase
(
uint16_t
PageAdr
)
=
0
;
virtual
void
BlockErase
(
uint16_t
BlockAdr
)
=
0
;
virtual
void
ChipErase
(
void
(
*
delay_cb
)(
unsigned
long
))
=
0
;
// internal high level functions
int16_t
find_last_page
(
void
);
int16_t
find_last_page_of_log
(
uint16_t
log_number
);
bool
check_wrapped
(
void
);
public:
unsigned
char
df_manufacturer
;
uint16_t
df_device
;
uint16_t
df_PageSize
;
DataFlash_Class
()
{}
// Constructor
virtual
void
Init
(
void
)
=
0
;
virtual
void
ReadManufacturerID
()
=
0
;
virtual
bool
CardInserted
(
void
)
=
0
;
int16_t
GetPage
(
void
);
int16_t
GetWritePage
(
void
);
// erase handling
void
EraseAll
(
void
(
*
delay_cb
)(
unsigned
long
));
bool
NeedErase
(
void
);
// Write methods
void
StartWrite
(
int16_t
PageAdr
);
void
FinishWrite
(
void
);
void
WriteByte
(
unsigned
char
data
);
void
WriteInt
(
int16_t
data
);
void
WriteLong
(
int32_t
data
);
// Read methods
void
StartRead
(
int16_t
PageAdr
);
unsigned
char
ReadByte
();
int16_t
ReadInt
();
int32_t
ReadLong
();
// file numbers
void
SetFileNumber
(
uint16_t
FileNumber
);
uint16_t
GetFileNumber
();
uint16_t
GetFilePage
();
// page handling
uint16_t
df_NumPages
;
// high level interface
int16_t
find_last_log
(
void
);
void
get_log_boundaries
(
uint8_t
log_num
,
int16_t
&
start_page
,
int16_t
&
end_page
);
uint8_t
get_num_logs
(
void
);
void
start_new_log
(
void
);
private:
// DataFlash Log variables...
unsigned
char
df_BufferNum
;
unsigned
char
df_Read_BufferNum
;
uint16_t
df_BufferIdx
;
uint16_t
df_Read_BufferIdx
;
uint16_t
df_PageAdr
;
uint16_t
df_Read_PageAdr
;
unsigned
char
df_Stop_Write
;
uint16_t
df_FileNumber
;
uint16_t
df_FilePage
;
virtual
void
WaitReady
()
=
0
;
virtual
void
BufferWrite
(
unsigned
char
BufferNum
,
uint16_t
IntPageAdr
,
unsigned
char
Data
)
=
0
;
virtual
void
BufferToPage
(
unsigned
char
BufferNum
,
uint16_t
PageAdr
,
unsigned
char
wait
)
=
0
;
virtual
void
PageToBuffer
(
unsigned
char
BufferNum
,
uint16_t
PageAdr
)
=
0
;
virtual
unsigned
char
BufferRead
(
unsigned
char
BufferNum
,
uint16_t
IntPageAdr
)
=
0
;
virtual
void
PageErase
(
uint16_t
PageAdr
)
=
0
;
virtual
void
BlockErase
(
uint16_t
BlockAdr
)
=
0
;
virtual
void
ChipErase
(
void
(
*
delay_cb
)(
unsigned
long
))
=
0
;
// internal high level functions
int16_t
find_last_page
(
void
);
int16_t
find_last_page_of_log
(
uint16_t
log_number
);
bool
check_wrapped
(
void
);
public:
unsigned
char
df_manufacturer
;
uint16_t
df_device
;
uint16_t
df_PageSize
;
DataFlash_Class
()
{
}
// Constructor
virtual
void
Init
(
void
)
=
0
;
virtual
void
ReadManufacturerID
()
=
0
;
virtual
bool
CardInserted
(
void
)
=
0
;
int16_t
GetPage
(
void
);
int16_t
GetWritePage
(
void
);
// erase handling
void
EraseAll
(
void
(
*
delay_cb
)(
unsigned
long
));
bool
NeedErase
(
void
);
// Write methods
void
StartWrite
(
int16_t
PageAdr
);
void
FinishWrite
(
void
);
void
WriteByte
(
unsigned
char
data
);
void
WriteInt
(
int16_t
data
);
void
WriteLong
(
int32_t
data
);
// Read methods
void
StartRead
(
int16_t
PageAdr
);
unsigned
char
ReadByte
();
int16_t
ReadInt
();
int32_t
ReadLong
();
// file numbers
void
SetFileNumber
(
uint16_t
FileNumber
);
uint16_t
GetFileNumber
();
uint16_t
GetFilePage
();
// page handling
uint16_t
df_NumPages
;
// high level interface
int16_t
find_last_log
(
void
);
void
get_log_boundaries
(
uint8_t
log_num
,
int16_t
&
start_page
,
int16_t
&
end_page
);
uint8_t
get_num_logs
(
void
);
void
start_new_log
(
void
);
};
...
...
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