-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathGlobs.h
104 lines (75 loc) · 1.82 KB
/
Globs.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#ifndef _GLOBS_H_
#define _GLOBS_H_
#define F_CPU 11059200UL
// #define F_CPU 7372800UL
#define _FLASHER_
#define TRUE 1
#define FALSE 0
#define CORES 32 // don't touch this
#define MAXASICS 32 // don't touch this ... max supported ASICS on board
#define ASICS 32 // can be 4, 24 or 32 ... real count of the ASISC on a board
#define JCELLS 8
#define FIFO 33
#define S_CHECK 0
#define S_READ 1
#define _VER_ 129
#define C_FIX 17 // 180 MHz
#ifdef _FLASHER_
#define SECTION_FLASH __attribute__ ((section (".flash")))
#endif
typedef unsigned int u_int;
typedef unsigned char u_char;
typedef unsigned long u_long;
typedef unsigned char BYTE;
typedef unsigned int WORD;
typedef unsigned long DWORD;
#define FLASH __attribute__ ((progmem))
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/pgmspace.h>
#include <util/delay.h>
#ifndef sbi
#define sbi(port,bit) (port |= (1<<bit))
#define cbi(port,bit) (port &= ~(1<<bit))
#define bis(port,bit) (port & (1<<bit))
#define bic(port,bit) (!(port & (1<<bit)))
#endif
#define SBI(port,bit) (port |= (1<<bit))
#define CBI(port,bit) (port &= ~(1<<bit))
#define BIS(port,bit) (port & (1<<bit))
#define BIC(port,bit) (!(port & (1<<bit)))
// typedef union tag_ncn {
// DWORD dwnonce;
// BYTE nonce[4];
// } U_NONCE;
typedef struct _tag_pair {
BYTE wload[44];
BYTE gnonc[4];
} S_PAIR;
#define SZ_PAIR sizeof(S_PAIR)
typedef struct _tag_abuf {
WORD incer;
BYTE cix;
} S_ABUF;
#define SZ_ABUF sizeof(S_ABUF)
typedef struct _tag_subm {
BYTE nonce[4];
WORD incer;
BYTE cix;
BYTE chip;
} S_SUBM;
#define SZ_SUBM sizeof(S_SUBM)
typedef struct _tag_Job {
BYTE midstate[32];
BYTE mpart[4];
BYTE ntime[4];
BYTE ndiff[4];
BYTE exnc2[4];
BYTE mj_ID;
// BYTE BrdIdx;
} S_MJOB;
#define SZ_MJOB sizeof(S_MJOB)
#endif