Skip to content

Commit bed8880

Browse files
shufpsPmaxsd
andauthored
Q1370 (#582)
* initial q1370 support * show active protocol on dashboard * cleaned up weird dashboard isystem struct default values * removed fan-guessing artifact code * can related changes --------- Co-authored-by: Pmaxsd <pmaxsd80@gmail.com>
1 parent 5f4154c commit bed8880

111 files changed

Lines changed: 76759 additions & 1061 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build.yml

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ on:
66
jobs:
77
build-and-release:
88
runs-on: ubuntu-latest
9+
env:
10+
RCLONE_CONF: ${{ secrets.RCLONE_CONF }}
911
strategy:
1012
matrix:
1113
include:
@@ -36,6 +38,9 @@ jobs:
3638
- board: NERDQX
3739
upload_www: false
3840
label: NerdQX
41+
- board: Q1370
42+
upload_www: false
43+
label: Q1370
3944

4045
steps:
4146
- name: Checkout repository
@@ -125,14 +130,6 @@ jobs:
125130
path: esp-miner-factory-${{ matrix.label }}-${{ env.VERSION_TAG }}.bin
126131
retention-days: 7
127132

128-
- name: Upload ELF for crash analysis
129-
if: env.RELEASE_EXISTS == 'false'
130-
uses: actions/upload-artifact@v4
131-
with:
132-
name: esp-miner-${{ matrix.label }}.elf
133-
path: build/esp-miner-${{ matrix.label }}.elf
134-
retention-days: 7
135-
136133
- name: Upload BIN firmware
137134
if: env.RELEASE_EXISTS == 'false'
138135
uses: actions/upload-artifact@v4
@@ -161,7 +158,9 @@ jobs:
161158
162159
- name: Set files variable
163160
id: set_files_var
164-
run: echo "files=$(cat file_list.txt | tr '\n' ',')" >> $GITHUB_ENV
161+
run: |
162+
echo "files=$(grep -v '\.elf$' file_list.txt | tr '\n' ',')" >> $GITHUB_ENV
163+
echo "r2_files=$(cat file_list.txt | tr '\n' ',')" >> $GITHUB_ENV
165164
166165
# Skip release upload if no release exists
167166
- name: Skip release upload if not tagged
@@ -178,21 +177,21 @@ jobs:
178177
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
179178

180179
- name: Install rclone
180+
if: env.RCLONE_CONF != ''
181181
run: |
182182
curl -fsSL https://rclone.org/install.sh | sudo bash
183183
184184
- name: Upload to Cloudflare R2 using rclone
185-
env:
186-
RCLONE_CONF: ${{ secrets.RCLONE_CONF }}
185+
if: env.RCLONE_CONF != ''
187186
run: |
188187
mkdir -p ~/.config/rclone
189188
echo "$RCLONE_CONF" > ~/.config/rclone/rclone.conf
190189
191190
TARGET_DIR="webflasher/${{ env.VERSION_TAG }}"
192191
193-
while read file; do
192+
echo "$r2_files" | tr ',' '\n' | grep -v '^$' | while read file; do
194193
rclone copyto "$file" "r2:${TARGET_DIR}/$(basename "$file")" --s3-acl public-read
195-
done < file_list.txt
194+
done
196195
197196
outputs:
198197
release_exists: ${{ env.RELEASE_EXISTS }}

.github/workflows/validate.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ jobs:
2828
label: NerdEKO
2929
- board: NERDQX
3030
label: NerdQX
31+
- board: Q1370
32+
label: Q1370
33+
3134
steps:
3235
- name: Checkout repository
3336
uses: actions/checkout@v3

components/bm1397/asic.cpp

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,6 @@ typedef enum
1919
} packet_type_t;
2020

2121

22-
typedef struct __attribute__((__packed__))
23-
{
24-
uint8_t job_id;
25-
uint8_t num_midstates;
26-
uint8_t starting_nonce[4];
27-
uint8_t nbits[4];
28-
uint8_t ntime[4];
29-
uint8_t merkle_root[32];
30-
uint8_t prev_block_hash[32];
31-
uint8_t version[4];
32-
} BM1368_job;
33-
3422
const static char* TAG = "asic";
3523

3624
Asic::Asic() {
@@ -347,6 +335,11 @@ uint8_t Asic::sendWork(uint32_t job_id, bm_job *next_bm_job)
347335
return job.job_id;
348336
}
349337

338+
void Asic::sendRawJob(BM1368_job *job)
339+
{
340+
send((TYPE_JOB | GROUP_SINGLE | CMD_WRITE), (uint8_t*) job, sizeof(BM1368_job));
341+
}
342+
350343
bool Asic::receiveWork(asic_result_t *result)
351344
{
352345
// wait for a response, wait time is pretty arbitrary

components/bm1397/include/asic.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@
22

33
#include "mining.h"
44

5+
typedef struct __attribute__((__packed__))
6+
{
7+
uint8_t job_id;
8+
uint8_t num_midstates;
9+
uint8_t starting_nonce[4];
10+
uint8_t nbits[4];
11+
uint8_t ntime[4];
12+
uint8_t merkle_root[32];
13+
uint8_t prev_block_hash[32];
14+
uint8_t version[4];
15+
} BM1368_job;
16+
517
#define CRC5_MASK 0x1F
618

719
// debug serial
@@ -118,6 +130,7 @@ class Asic {
118130
Asic();
119131
virtual const char* getName() = 0;
120132
uint8_t sendWork(uint32_t job_id, bm_job *next_bm_job);
133+
void sendRawJob(BM1368_job *job);
121134
bool processWork(task_result *result);
122135
void setJobDifficultyMask(int difficulty);
123136
bool setAsicFrequency(float frequency);

components/connect/CMakeLists.txt

Lines changed: 0 additions & 13 deletions
This file was deleted.

components/connect/Kconfig.projbuild

Lines changed: 0 additions & 67 deletions
This file was deleted.

0 commit comments

Comments
 (0)