MCPcopy Create free account
hub / github.com/PaulStoffregen/SerialFlash / check_signature

Function check_signature

SerialFlashDirectory.cpp:68–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66
67
68static uint32_t check_signature(void)
69{
70 uint32_t sig[2];
71
72 SerialFlash.read(0, sig, 8);
73 //Serial.printf("sig: %08X %08X\n", sig[0], sig[1]);
74 if (sig[0] == 0xFA96554C) return sig[1];
75 if (sig[0] == 0xFFFFFFFF) {
76 sig[0] = 0xFA96554C;
77 sig[1] = ((uint32_t)(DEFAULT_STRINGS_SIZE/4) << 16) | DEFAULT_MAXFILES;
78 SerialFlash.write(0, sig, 8);
79 while (!SerialFlash.ready()) ; // TODO: timeout
80 SerialFlash.read(0, sig, 8);
81 if (sig[0] == 0xFA96554C) return sig[1];
82 }
83 return 0;
84}
85
86static uint16_t filename_hash(const char *filename)
87{

Callers 3

openMethod · 0.85
createMethod · 0.85
readdirMethod · 0.85

Calls 3

readyMethod · 0.80
readMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected