diff --git a/control/src/drv/b15f.cpp b/control/src/drv/b15f.cpp index de24850..36a43fa 100644 --- a/control/src/drv/b15f.cpp +++ b/control/src/drv/b15f.cpp @@ -235,7 +235,7 @@ uint8_t B15F::digitalRead0() usart.clearInputBuffer(); uint8_t rq[] = { - RQ_BE0 + RQ_DIGITAL_READ_0 }; usart.transmit(&rq[0], 0, sizeof(rq)); @@ -249,7 +249,7 @@ uint8_t B15F::digitalRead1() usart.clearInputBuffer(); uint8_t rq[] = { - RQ_BE1 + RQ_DIGITAL_READ_1 }; usart.transmit(&rq[0], 0, sizeof(rq)); @@ -263,7 +263,7 @@ uint8_t B15F::readDipSwitch() usart.clearInputBuffer(); uint8_t rq[] = { - RQ_DSW + RQ_READ_DIP_SWITCH }; usart.transmit(&rq[0], 0, sizeof(rq)); @@ -276,7 +276,7 @@ bool B15F::analogWrite0(uint16_t value) { uint8_t rq[] = { - RQ_AA0, + RQ_ANALOG_WRITE_0, static_cast(value & 0xFF), static_cast(value >> 8) }; @@ -291,7 +291,7 @@ bool B15F::analogWrite1(uint16_t value) { uint8_t rq[] = { - RQ_AA1, + RQ_ANALOG_WRITE_1, static_cast(value & 0xFF), static_cast(value >> 8) }; @@ -310,7 +310,7 @@ uint16_t B15F::analogRead(uint8_t channel) uint8_t rq[] = { - RQ_ADC, + RQ_ANALOG_READ, channel }; @@ -425,7 +425,7 @@ bool B15F::setRegister(volatile uint8_t* adr, uint8_t val) uint8_t rq[] = { - RQ_SET_REG, + RQ_SET_REGISTER, static_cast(reinterpret_cast(adr)), val }; @@ -443,7 +443,7 @@ uint8_t B15F::getRegister(volatile uint8_t* adr) uint8_t rq[] = { - RQ_GET_REG, + RQ_GET_REGISTER, static_cast(reinterpret_cast(adr)) }; diff --git a/firmware/request_handlers.cpp b/firmware/request_handlers.cpp index 8c28418..dddb624 100644 --- a/firmware/request_handlers.cpp +++ b/firmware/request_handlers.cpp @@ -27,35 +27,35 @@ void handleRequest() rqSelfTest(); break; - case RQ_BA0: + case RQ_DIGITAL_WRITE_0: rqDigitalWrite0(); break; - case RQ_BA1: + case RQ_DIGITAL_WRITE_1: rqDigitalWrite1(); break; - case RQ_BE0: + case RQ_DIGITAL_READ_0: rqDigitalRead0(); break; - case RQ_BE1: + case RQ_DIGITAL_READ_1: rqDigitalRead1(); break; - case RQ_DSW: + case RQ_READ_DIP_SWITCH: rqReadDipSwitch(); break; - case RQ_AA0: + case RQ_ANALOG_WRITE_0: rqAnalogWrite0(); break; - case RQ_AA1: + case RQ_ANALOG_WRITE_1: rqAnalogWrite1(); break; - case RQ_ADC: + case RQ_ANALOG_READ: rqAnalogRead(); break; @@ -71,11 +71,11 @@ void handleRequest() rqPwmSetValue(); break; - case RQ_SET_REG: + case RQ_SET_REGISTER: rqSetRegister(); break; - case RQ_GET_REG: + case RQ_GET_REGISTER: rqGetRegister(); break; diff --git a/firmware/requests.h b/firmware/requests.h index 6175970..5a8c2d3 100644 --- a/firmware/requests.h +++ b/firmware/requests.h @@ -8,17 +8,17 @@ constexpr static uint8_t RQ_INT_TEST = 3; constexpr static uint8_t RQ_SELF_TEST = 4; constexpr static uint8_t RQ_DIGITAL_WRITE_0 = 5; constexpr static uint8_t RQ_DIGITAL_WRITE_1 = 6; -constexpr static uint8_t RQ_BE0 = 7; -constexpr static uint8_t RQ_BE1 = 8; -constexpr static uint8_t RQ_DSW = 9; -constexpr static uint8_t RQ_AA0 = 10; -constexpr static uint8_t RQ_AA1 = 11; -constexpr static uint8_t RQ_ADC = 12; +constexpr static uint8_t RQ_DIGITAL_READ_0 = 7; +constexpr static uint8_t RQ_DIGITAL_READ_1 = 8; +constexpr static uint8_t RQ_READ_DIP_SWITCH = 9; +constexpr static uint8_t RQ_ANALOG_WRITE_0 = 10; +constexpr static uint8_t RQ_ANALOG_WRITE_1 = 11; +constexpr static uint8_t RQ_ANALOG_READ = 12; constexpr static uint8_t RQ_ADC_DAC_STROKE = 13; constexpr static uint8_t RQ_PWM_SET_FREQ = 14; constexpr static uint8_t RQ_PWM_SET_VALUE = 15; -constexpr static uint8_t RQ_SET_REG = 16; -constexpr static uint8_t RQ_GET_REG = 17; +constexpr static uint8_t RQ_SET_REGISTER = 16; +constexpr static uint8_t RQ_GET_REGISTER = 17; uint8_t const rq_len[] = { /* RQ_DISC */ 1,