mirror of
https://github.com/skot/ESP-Miner.git
synced 2025-03-26 17:51:45 +01:00
accept/reject share count
This commit is contained in:
parent
b1651ed97c
commit
20eb6ab92e
@ -170,7 +170,7 @@ static void ASIC_task(void * pvParameters)
|
||||
//print_hex((uint8_t *)&job, sizeof(struct job_packet), sizeof(struct job_packet), "job: ");
|
||||
submit_share(sock, STRATUM_USER, active_jobs[nonce.job_id]->jobid, active_jobs[nonce.job_id]->ntime,
|
||||
active_jobs[nonce.job_id]->extranonce2, nonce.nonce);
|
||||
notify_system_submitted_share();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -343,8 +343,10 @@ static void stratum_task(void * pvParameters)
|
||||
int16_t parsed_id;
|
||||
if (parse_stratum_result_message(line, &parsed_id)) {
|
||||
ESP_LOGI(TAG, "message id %d result accepted", parsed_id);
|
||||
notify_system_accepted_share();
|
||||
} else {
|
||||
ESP_LOGI(TAG, "message id %d result rejected", parsed_id);
|
||||
notify_system_rejected_share();
|
||||
}
|
||||
} else {
|
||||
free(line);
|
||||
|
@ -23,7 +23,8 @@ static const char *TAG = "system";
|
||||
static char oled_buf[20];
|
||||
static int screen_page = 0;
|
||||
|
||||
static int shares_submitted = 0;
|
||||
static uint16_t shares_accepted = 0;
|
||||
static uint16_t shares_rejected = 0;
|
||||
static time_t start_time;
|
||||
|
||||
static double duration_start = 0;
|
||||
@ -65,14 +66,19 @@ void update_shares(void){
|
||||
}
|
||||
OLED_clearLine(2);
|
||||
memset(oled_buf, 0, 20);
|
||||
snprintf(oled_buf, 20, "Shares: %i", shares_submitted);
|
||||
snprintf(oled_buf, 20, "A/R: %u/%u", shares_accepted, shares_rejected);
|
||||
OLED_writeString(0, 2, oled_buf);
|
||||
}
|
||||
|
||||
void notify_system_submitted_share(void){
|
||||
shares_submitted++;
|
||||
void notify_system_accepted_share(void){
|
||||
shares_accepted++;
|
||||
update_shares();
|
||||
}
|
||||
void notify_system_rejected_share(void){
|
||||
shares_rejected++;
|
||||
update_shares();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -4,7 +4,8 @@
|
||||
void system_task(void *arg);
|
||||
void init_system(void);
|
||||
void get_stats(void);
|
||||
void notify_system_submitted_share(void);
|
||||
void notify_system_accepted_share(void);
|
||||
void notify_system_rejected_share(void);
|
||||
void notify_system_found_nonce(double nonce_diff);
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user