FlashStorage icon indicating copy to clipboard operation
FlashStorage copied to clipboard

840 byte struct can crash function ?

Open gioreva opened this issue 5 years ago • 0 comments

Can crash ?

Cpu is ARM SAMD and has 32KB of RAM

#include <FlashStorage.h>
Tbb Timer;
FlashStorage(Tim, Tbb);

Timer = Tim.read();

typedef  struct {
  byte L_on1_H;
  byte L_on1_M;
  byte L_of1_H;
  byte L_of1_M;
  byte L_on2_H;
  byte L_on2_M;
  byte L_of2_H;
  byte L_of2_M;
  
  byte M_on1_H;
  byte M_on1_M;
  byte M_of1_H;
  byte M_of1_M;
  byte M_on2_H;
  byte M_on2_M;
  byte M_of2_H;
  byte M_of2_M;
  
  byte Me_on1_H;
  byte Me_on1_M;
  byte Me_of1_H;
  byte Me_of1_M;
  byte Me_on2_H;
  byte Me_on2_M;
  byte Me_of2_H;
  byte Me_of2_M;
  
  byte G_on1_H;
  byte G_on1_M;
  byte G_of1_H;
  byte G_of1_M;
  byte G_on2_H;
  byte G_on2_M;
  byte G_of2_H;
  byte G_of2_M;
  
  byte V_on1_H;
  byte V_on1_M;
  byte V_of1_H;
  byte V_of1_M;
  byte V_on2_H;
  byte V_on2_M;
  byte V_of2_H;
  byte V_of2_M;
  
  byte S_on1_H;
  byte S_on1_M;
  byte S_of1_H;
  byte S_of1_M;
  byte S_on2_H;
  byte S_on2_M;
  byte S_of2_H;
  byte S_of2_M;
  
  byte D_on1_H;
  byte D_on1_M;
  byte D_of1_H;
  byte D_of1_M;
  byte D_on2_H;
  byte D_on2_M;
  byte D_of2_H;
  byte D_of2_M;
  
} Taa;  // 8x7 = 56 byte.

typedef  struct {
	Taa Giorno[15];
  byte AutoZero;

} Tbb; // 56 x 15 = 840 bytetypedef  struct {
  byte L_on1_H;
  byte L_on1_M;
  byte L_of1_H;
  byte L_of1_M;
  byte L_on2_H;
  byte L_on2_M;
  byte L_of2_H;
  byte L_of2_M;
  
  byte M_on1_H;
  byte M_on1_M;
  byte M_of1_H;
  byte M_of1_M;
  byte M_on2_H;
  byte M_on2_M;
  byte M_of2_H;
  byte M_of2_M;
  
  byte Me_on1_H;
  byte Me_on1_M;
  byte Me_of1_H;
  byte Me_of1_M;
  byte Me_on2_H;
  byte Me_on2_M;
  byte Me_of2_H;
  byte Me_of2_M;
  
  byte G_on1_H;
  byte G_on1_M;
  byte G_of1_H;
  byte G_of1_M;
  byte G_on2_H;
  byte G_on2_M;
  byte G_of2_H;
  byte G_of2_M;
  
  byte V_on1_H;
  byte V_on1_M;
  byte V_of1_H;
  byte V_of1_M;
  byte V_on2_H;
  byte V_on2_M;
  byte V_of2_H;
  byte V_of2_M;
  
  byte S_on1_H;
  byte S_on1_M;
  byte S_of1_H;
  byte S_of1_M;
  byte S_on2_H;
  byte S_on2_M;
  byte S_of2_H;
  byte S_of2_M;
  
  byte D_on1_H;
  byte D_on1_M;
  byte D_of1_H;
  byte D_of1_M;
  byte D_on2_H;
  byte D_on2_M;
  byte D_of2_H;
  byte D_of2_M;
  
} Taa;  // 8x7 = 56 byte.

typedef  struct {
	Taa Giorno[15];
  byte AutoZero;

} Tbb; // 56 x 15 = 840 byte

gioreva avatar Feb 26 '20 18:02 gioreva