Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions components/asic/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
idf_component_register(
SRCS
"bm1340.c"
"bm1370.c"
"bm1368.c"
"bm1366.c"
Expand Down
21 changes: 19 additions & 2 deletions components/asic/asic.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "bm1366.h"
#include "bm1368.h"
#include "bm1370.h"
#include "bm1340.h"

#include "asic.h"
#include "device_config.h"
Expand All @@ -28,7 +29,9 @@ uint8_t ASIC_init(GlobalState * GLOBAL_STATE)
return BM1368_init(GLOBAL_STATE->POWER_MANAGEMENT_MODULE.frequency_value, GLOBAL_STATE->DEVICE_CONFIG.family.asic_count, GLOBAL_STATE->DEVICE_CONFIG.family.asic.difficulty);
case BM1370:
return BM1370_init(GLOBAL_STATE->POWER_MANAGEMENT_MODULE.frequency_value, GLOBAL_STATE->DEVICE_CONFIG.family.asic_count, GLOBAL_STATE->DEVICE_CONFIG.family.asic.difficulty);
}
case BM1340:
return BM1340_init(GLOBAL_STATE->POWER_MANAGEMENT_MODULE.frequency_value, GLOBAL_STATE->DEVICE_CONFIG.family.asic_count, GLOBAL_STATE->DEVICE_CONFIG.family.asic.difficulty);
}
return ESP_OK;
}

Expand All @@ -43,7 +46,9 @@ task_result * ASIC_process_work(GlobalState * GLOBAL_STATE)
return BM1368_process_work(GLOBAL_STATE);
case BM1370:
return BM1370_process_work(GLOBAL_STATE);
}
case BM1340:
return BM1340_process_work(GLOBAL_STATE);
}
return NULL;
}

Expand All @@ -58,6 +63,8 @@ int ASIC_set_max_baud(GlobalState * GLOBAL_STATE)
return BM1368_set_max_baud();
case BM1370:
return BM1370_set_max_baud();
case BM1340:
return BM1340_set_max_baud();
}
return 0;
}
Expand All @@ -77,6 +84,9 @@ void ASIC_send_work(GlobalState * GLOBAL_STATE, void * next_job)
case BM1370:
BM1370_send_work(GLOBAL_STATE, next_job);
break;
case BM1340:
BM1340_send_work(GLOBAL_STATE, next_job);
break;
}
}

Expand All @@ -95,6 +105,9 @@ void ASIC_set_version_mask(GlobalState * GLOBAL_STATE, uint32_t mask)
case BM1370:
BM1370_set_version_mask(mask);
break;
case BM1340:
BM1340_set_version_mask(mask);
break;
}
}

Expand All @@ -113,6 +126,9 @@ bool ASIC_set_frequency(GlobalState * GLOBAL_STATE, float frequency)
case BM1370:
do_frequency_transition(frequency, BM1370_send_hash_frequency);
return true;
case BM1340:
do_frequency_transition(frequency, BM1340_send_hash_frequency);
return true;
}
return false;
}
Expand All @@ -127,6 +143,7 @@ double ASIC_get_asic_job_frequency_ms(GlobalState * GLOBAL_STATE)
return 2000;
case BM1368:
case BM1370:
case BM1340:
return 500;
}
return 500;
Expand Down
Loading
Loading