adjust fram address size

This commit is contained in:
Siwat Sirichai 2024-02-10 16:30:23 +07:00
parent 6c418115ec
commit 7a67732daf
2 changed files with 3 additions and 3 deletions

View File

@ -8,7 +8,7 @@ CurrentTransformer::CurrentTransformer(AnalogCard* analogCard, uint8_t pin, floa
this->adcToCurrent = adcToCurrent; this->adcToCurrent = adcToCurrent;
} }
void CurrentTransformer::bindFRAM(FRAM *fram, uint8_t framAddress) void CurrentTransformer::bindFRAM(FRAM *fram, uint32_t framAddress)
{ {
this->fram = fram; this->fram = fram;
this->framAddress = framAddress; this->framAddress = framAddress;

View File

@ -12,7 +12,7 @@ class CurrentTransformer
{ {
public: public:
CurrentTransformer(AnalogCard* analogCard, uint8_t pin, float *voltage, std::function<float(uint16_t)> adcToCurrent, uint32_t conversionInterval); CurrentTransformer(AnalogCard* analogCard, uint8_t pin, float *voltage, std::function<float(uint16_t)> adcToCurrent, uint32_t conversionInterval);
void bindFRAM(FRAM *fram, uint8_t framAddress); // Takes 16 bytes of FRAM (long double energy) void bindFRAM(FRAM *fram, uint32_t framAddress); // Takes 16 bytes of FRAM (long double energy)
void begin(); void begin();
void loop(); void loop();
void beginConversion(); void beginConversion();
@ -30,7 +30,7 @@ class CurrentTransformer
private: private:
AnalogCard* analogCard; AnalogCard* analogCard;
uint8_t pin; uint8_t pin;
uint8_t framAddress; uint32_t framAddress;
FRAM *fram; FRAM *fram;
uint32_t conversionInterval; uint32_t conversionInterval;
bool autoSave; bool autoSave;