sketchbook
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
General_Stuff.h
Go to the documentation of this file.
1 // General_Stuff.h
2 //
3 // Variables and defines required by all sketches
4 //
5 // Author: Nick Gammon
6 
7 /* ----------------------------------------------------------------------------
8 NOTE: This file should only be modified in the Atmega_Hex_Uploader directory.
9 Copies in other directories are hard-linked to this one.
10 After modifying it run the shell script:
11  fixup_links.sh
12 This script needs to be run in the directories:
13  Atmega_Board_Programmer and Atmega_Board_Detector
14 That will ensure that those directories now are using the same file.
15 ------------------------------------------------------------------------------ */
16 
17 
18 unsigned long pagesize;
19 unsigned long pagemask;
20 unsigned long oldPage;
21 
22 // count errors
23 unsigned int errors;
24 
25 const unsigned long NO_PAGE = 0xFFFFFFFF;
26 
27 unsigned int progressBarCount;
28 
29 // if signature found in signature table, this is its index
30 int foundSig = -1;
32 // copy of current signature entry for matching processor
34 
35 
36 // number of items in an array
37 #define NUMITEMS(arg) ((unsigned int) (sizeof (arg) / sizeof (arg [0])))
38 
39 // stringification for Arduino IDE version
40 #define xstr(s) str(s)
41 #define str(s) #s
42 
43 void showHex (const byte b, const boolean newline = false, const boolean show0x = true);
44 void showYesNo (const boolean b, const boolean newline = false);
45 void commitPage (unsigned long addr, bool showMessage = false);
unsigned long oldPage
Definition: General_Stuff.h:20
unsigned long pagesize
Definition: General_Stuff.h:18
uint8_t byte
Definition: Arduino.h:123
byte lastAddressMSB
Definition: General_Stuff.h:31
unsigned long pagemask
Definition: General_Stuff.h:19
void commitPage(unsigned long addr, bool showMessage=false)
byte addr[8]
Definition: OWP_DG_1w-adaptor.ino:104
int32_t int16_t b
Definition: IMU.cpp:172
signatureType currentSignature
Definition: General_Stuff.h:33
unsigned int progressBarCount
Definition: General_Stuff.h:27
Definition: Signatures.h:31
const unsigned long NO_PAGE
Definition: General_Stuff.h:25
int foundSig
Definition: General_Stuff.h:30
void showHex(const byte b, const boolean newline=false, const boolean show0x=true)
Definition: Programming_Utils.ino:61
unsigned int errors
Definition: General_Stuff.h:23
void showYesNo(const boolean b, const boolean newline=false)
Definition: Programming_Utils.ino:82