Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

840 byte struct can crash function ? #33

Open
gioreva opened this issue Feb 26, 2020 · 0 comments
Open

840 byte struct can crash function ? #33

gioreva opened this issue Feb 26, 2020 · 0 comments

Comments

@gioreva
Copy link

gioreva commented Feb 26, 2020

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant