Skip to content

840 byte struct can crash function ? #33

@gioreva

Description

@gioreva

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions