kopia lustrzana https://github.com/pimoroni/pimoroni-pico
Fix ioe reset timing out too early, and encoder reversed
rodzic
226e7507dd
commit
e3f9f14dcf
|
@ -366,7 +366,7 @@ namespace pimoroni {
|
|||
// Wait for a register to read its initialised value
|
||||
while(check_reset() != 0x78) {
|
||||
sleep_ms(1);
|
||||
if(millis() - start_time >= timeout) {
|
||||
if(millis() - start_time >= RESET_TIMEOUT_MS) {
|
||||
if(debug)
|
||||
printf("Timed out waiting for Reset!");
|
||||
return false;
|
||||
|
|
|
@ -26,6 +26,8 @@ namespace pimoroni {
|
|||
static const uint8_t PIN_MODE_PWM = 0b00101; // PWM, Output, Push-Pull mode
|
||||
static const uint8_t PIN_MODE_ADC = 0b01010; // ADC, Input-only (high-impedance)
|
||||
|
||||
static const uint32_t RESET_TIMEOUT_MS = 1000;
|
||||
|
||||
public:
|
||||
static const uint8_t DEFAULT_I2C_ADDRESS = 0x18;
|
||||
|
||||
|
|
|
@ -27,8 +27,8 @@ namespace pimoroni {
|
|||
|
||||
private:
|
||||
static const uint8_t ENC_CHANNEL = 1;
|
||||
static const uint8_t ENC_TERM_A = 12;
|
||||
static const uint8_t ENC_TERM_B = 3;
|
||||
static const uint8_t ENC_TERM_A = 3;
|
||||
static const uint8_t ENC_TERM_B = 12;
|
||||
static const uint8_t ENC_COUNTS_PER_REV = 24;
|
||||
static const uint8_t ENC_COUNT_DIVIDER = 2;
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue