HAL cleanup, Teensy 3.1 platform

This commit is contained in:
Scott Lahteine
2019-08-02 07:22:07 -05:00
parent 940c59d9da
commit e85eca2630
12 changed files with 146 additions and 78 deletions

View File

@ -19,19 +19,17 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#pragma once
/**
* Description: HAL for Teensy 3.5 and Teensy 3.6
*/
#pragma once
#define CPU_32_BIT
#include "../shared/Marduino.h"
#include "../math_32bit.h"
#include "../HAL_SPI.h"
#include "../shared/math_32bit.h"
#include "../shared/HAL_SPI.h"
#include "fastio_Teensy.h"
#include "watchdog_Teensy.h"

View File

@ -24,13 +24,10 @@
#include "../shared/persistent_store_api.h"
namespace HAL {
namespace PersistentStore {
bool PersistentStore::access_start() { return true; }
bool PersistentStore::access_finish() { return true; }
bool access_start() { return true; }
bool access_finish() { return true; }
bool write_data(int &pos, const uint8_t *value, uint16_t size, uint16_t *crc) {
bool PersistentStore::write_data(int &pos, const uint8_t *value, uint16_t size, uint16_t *crc) {
while (size--) {
uint8_t * const p = (uint8_t * const)pos;
uint8_t v = *value;
@ -50,7 +47,7 @@ bool write_data(int &pos, const uint8_t *value, uint16_t size, uint16_t *crc) {
return false;
}
bool read_data(int &pos, uint8_t* value, uint16_t size, uint16_t *crc, const bool writing/*=true*/) {
bool PersistentStore::read_data(int &pos, uint8_t* value, uint16_t size, uint16_t *crc, const bool writing/*=true*/) {
do {
uint8_t c = eeprom_read_byte((uint8_t*)pos);
if (writing) *value = c;
@ -61,8 +58,5 @@ bool read_data(int &pos, uint8_t* value, uint16_t size, uint16_t *crc, const boo
return false;
}
} // PersistentStore
} // HAL
#endif // EEPROM_SETTINGS
#endif // __MK20DX256__