Permalink
Browse files

Removed all Arduino SD card library files. SD.h is now required in th…

…e main program includes.
  • Loading branch information...
infomaniac50 committed Apr 6, 2013
1 parent 2f8f2fd commit 9a5372e8cf60c02f9a348fdb1249628c5c6f75c0
Showing with 4 additions and 5,134 deletions.
  1. +1 −2 Logger.cpp
  2. +3 −3 Logger.h
  3. +0 −150 LoggerFile.cpp
  4. +0 −616 LoggerSD.cpp
  5. +0 −107 LoggerSD.h
  6. +0 −418 utility/FatStructs.h
  7. +0 −648 utility/Sd2Card.cpp
  8. +0 −233 utility/Sd2Card.h
  9. +0 −353 utility/Sd2PinMap.h
  10. +0 −547 utility/SdFat.h
  11. +0 −75 utility/SdFatUtil.h
  12. +0 −202 utility/SdFatmainpage.h
  13. +0 −1,253 utility/SdFile.cpp
  14. +0 −232 utility/SdInfo.h
  15. +0 −295 utility/SdVolume.cpp
View
@@ -5,9 +5,8 @@
*/
#include "Logger.h"
-#include <LoggerSD.h>
-Logger::Logger(log_outputs output, data_formats format, boolean add_line_break, uint chip_select)
+Logger::Logger(log_outputs output, data_formats format, boolean add_line_break, uint8_t chip_select)
{
_chip_select = chip_select;
_output = output;
View
@@ -13,7 +13,7 @@
#include "WProgram.h"
#endif
-#include <LoggerSD.h>
+#include <SD.h>
enum log_outputs
{
@@ -31,7 +31,7 @@ enum data_formats
class Logger
{
public:
- Logger(log_outputs output, data_formats format, boolean add_line_break);
+ Logger(log_outputs output, data_formats format, boolean add_line_break, uint8_t chip_select);
void logData(byte data);
int init();
// void logData(int data);
@@ -48,6 +48,6 @@ class Logger
log_outputs _output;
data_formats _format;
boolean _add_line_break;
- uint _chip_select;
+ uint8_t _chip_select;
};
#endif
View
@@ -1,150 +0,0 @@
-/*
-
- SD - a slightly more friendly wrapper for sdfatlib
-
- This library aims to expose a subset of SD card functionality
- in the form of a higher level "wrapper" object.
-
- License: GNU General Public License V3
- (Because sdfatlib is licensed with this.)
-
- (C) Copyright 2010 SparkFun Electronics
-
- */
-
-#include <LoggerSD.h>
-
-/* for debugging file open/close leaks
- uint8_t nfilecount=0;
-*/
-
-File::File(SdFile f, const char *n) {
- // oh man you are kidding me, new() doesnt exist? Ok we do it by hand!
- _file = (SdFile *)malloc(sizeof(SdFile));
- if (_file) {
- memcpy(_file, &f, sizeof(SdFile));
-
- strncpy(_name, n, 12);
- _name[12] = 0;
-
- /* for debugging file open/close leaks
- nfilecount++;
- Serial.print("Created \"");
- Serial.print(n);
- Serial.print("\": ");
- Serial.println(nfilecount, DEC);
- */
- }
-}
-
-File::File(void) {
- _file = 0;
- _name[0] = 0;
- //Serial.print("Created empty file object");
-}
-
-File::~File(void) {
- // Serial.print("Deleted file object");
-}
-
-// returns a pointer to the file name
-char *File::name(void) {
- return _name;
-}
-
-// a directory is a special type of file
-boolean File::isDirectory(void) {
- return (_file && _file->isDir());
-}
-
-
-size_t File::write(uint8_t val) {
- return write(&val, 1);
-}
-
-size_t File::write(const uint8_t *buf, size_t size) {
- size_t t;
- if (!_file) {
- setWriteError();
- return 0;
- }
- _file->clearWriteError();
- t = _file->write(buf, size);
- if (_file->getWriteError()) {
- setWriteError();
- return 0;
- }
- return t;
-}
-
-int File::peek() {
- if (! _file)
- return 0;
-
- int c = _file->read();
- if (c != -1) _file->seekCur(-1);
- return c;
-}
-
-int File::read() {
- if (_file)
- return _file->read();
- return -1;
-}
-
-// buffered read for more efficient, high speed reading
-int File::read(void *buf, uint16_t nbyte) {
- if (_file)
- return _file->read(buf, nbyte);
- return 0;
-}
-
-int File::available() {
- if (! _file) return 0;
-
- uint32_t n = size() - position();
-
- return n > 0X7FFF ? 0X7FFF : n;
-}
-
-void File::flush() {
- if (_file)
- _file->sync();
-}
-
-boolean File::seek(uint32_t pos) {
- if (! _file) return false;
-
- return _file->seekSet(pos);
-}
-
-uint32_t File::position() {
- if (! _file) return -1;
- return _file->curPosition();
-}
-
-uint32_t File::size() {
- if (! _file) return 0;
- return _file->fileSize();
-}
-
-void File::close() {
- if (_file) {
- _file->close();
- free(_file);
- _file = 0;
-
- /* for debugging file open/close leaks
- nfilecount--;
- Serial.print("Deleted ");
- Serial.println(nfilecount, DEC);
- */
- }
-}
-
-File::operator bool() {
- if (_file)
- return _file->isOpen();
- return false;
-}
-
Oops, something went wrong.

0 comments on commit 9a5372e

Please sign in to comment.