PCMaster2165
Member
Hey guys, I'm wondering why certain things dont seem to be able to be allocated to RAM2 instead of RAM1. My example being "
DMAMEM RingBuf<FsFile, sizeof(DATA_LOGGER_FRAME) * 15> BUFFER; //Enough to store 60ms of data" produces error: "Compilation error: section attribute not allowed for 'BUFFER'" in the code:
Any ideas what I'm doing wrong or how to make it work?
DMAMEM RingBuf<FsFile, sizeof(DATA_LOGGER_FRAME) * 15> BUFFER; //Enough to store 60ms of data" produces error: "Compilation error: section attribute not allowed for 'BUFFER'" in the code:
Code:
#ifndef DATA_LOGGER_H
#define DATA_LOGGER_H
#include "Structs.h"
#include "Telemetry.h"
#include "SdFat.h"
#include "RingBuf.h"
const int DATA_LOGGER_DISABLED = 0;
const int DATA_LOGGER_ENABLED = 1;
class DATALOGGER {
public:
DATALOGGER(DRONE_SETTINGS drone_settings, TELEMETRY* telemetry);
void start();
void startDataLogging();
void endDataLogging();
void endDataLoggingEmergency();
void addData(RECEIVER_DATA* receiver_data, IMU_DATA* imu_data, ALTITUDE_DATA* altitude_data, SAFETY_DATA* safety_data, DRONE_ARMING_DATA* drone_arming_data, GPS_DATA* gps_data, STEPPER_MOTOR_DATA* stepper_motor_data, TELEMETRY_DATA* telemetry_data, ESC_DATA* esc_data, PID_DATA* pid_data);
private:
DRONE_SETTINGS drone_settings;
TELEMETRY* telemetry;
const String DIRECTORY_TO_BINARY_FILE = "drone_data.bin";
const String DIRECTORY_TO_TEXT_FILE = "drone_data.txt";
const String DIRECTORY_TO_EMERGENCY_TEXT_FILE = "emergency_dump.txt";
const String DIRECTORY_TO_ROOT = "/";
const uint64_t FILE_PRE_ALLOCATION_SIZE = sizeof(DATA_LOGGER_FRAME) * 250 * 1800; //Enough To Store 30 Minutes Of Flight
SdFs SD;
FsFile BINARY_FILE, TEXT_FILE, EMERGENCY_DUMP_FILE;
DMAMEM RingBuf<FsFile, sizeof(DATA_LOGGER_FRAME) * 15> BUFFER; //Enough to store 60ms of data
const size_t BUFFER_WRITE_OUT_SIZE = 4096; //old value 4096 but with inclusion of massive pid struct I expanded write size
uint32_t FLIGHT_NUMBER = 1;
bool DISABLE_DATA_LOGGER = false;
String getDirectoryWithFlightNumberAdded(String existing_directory, uint32_t flight);
void deleteAllExistingFiles();
void processEmergencyDumpFile();
};
#endif
Any ideas what I'm doing wrong or how to make it work?