Performs memset after checking if the malloc was successful.
Safer, avoids segfault on (unlikely) unsuccessful malloc,
and allows the error printing to occur.
Fix all compiler warnings and migrate off depreciated ADC and I2C libraries.
---------
Co-authored-by: Erik Olof Gunnar Andersson <eandersson@users.noreply.github.com>
* add extended nonce debugging
* switch to semaphore for job timing
* clean up nonce debugging. hardcode 1366 job interval to 2s and show when new jobs are sent
* set nonce range to 0x0F0000 set job interval to 20s. better stratum debugging,
* testing out longer intervals on 1368
* looking at exact serial commands sent
* fix log value digit count
* add core from nonce debug
* set BM1366 initial chip difficulty to 32
* add version rolling debug
* improve debug printing again
* fix diff
* fix core_id extraction
* printf fix
* debug cleanup
* setup BM1368 for testing. reg10 to S21 default, job interval @ 0.5s
* set init diff on 1366 and 1368 back to 256
---------
Co-authored-by: Georges Palauqui <g.palauqui@gptechinno.com>
* Clean up and return 0 on recv, let task reconnect
* Set json buffer to null
---------
Co-authored-by: tommy <tommy@tommywatson.com>
Co-authored-by: Skot <skot@bitnet.cx>
* rough strategy for this fix. needs testing
* seems to be working with OCEAN. need to make sure nothing else is broken
* add version mask debug
* removed stratum setup response results from A/R shares tally
Job packets can have more that 1 midstate. If the stratum supports
version-rolling, calculate additional midstates by incrementing
the version with the version_mask provided by the stratum server.
Currently does 4 midstates for each extranonce2.
Current implementation has a race condition with the first
mining.notify message and can cause the miner to take a long time
to start if it misses that message.
Split parsing into two steps, one for the method and one for the
params themselves. Currently it is up to the miner task to grab
the parameters in the format it needs.