Standardize some hexadecimals
This commit is contained in:
@ -247,7 +247,7 @@ uint16_t HAL_adc_get_result(void) {
|
||||
data = lowpass_filter[adc_channel].update(data);
|
||||
#endif
|
||||
|
||||
return ((data >> 2) & 0x3ff); // return 10bit value as Marlin expects
|
||||
return ((data >> 2) & 0x3FF); // return 10bit value as Marlin expects
|
||||
}
|
||||
|
||||
#define SBIT_CNTEN 0
|
||||
|
@ -83,14 +83,14 @@
|
||||
}
|
||||
|
||||
uint8_t spiRec() {
|
||||
uint8_t b = spiTransfer(0xff);
|
||||
uint8_t b = spiTransfer(0xFF);
|
||||
return b;
|
||||
}
|
||||
|
||||
void spiRead(uint8_t*buf, uint16_t nbyte) {
|
||||
if (nbyte == 0) return;
|
||||
for (int i = 0; i < nbyte; i++) {
|
||||
buf[i] = spiTransfer(0xff);
|
||||
buf[i] = spiTransfer(0xFF);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -213,7 +213,7 @@ void LPC1768_PWM_sort(void) {
|
||||
}
|
||||
}
|
||||
|
||||
bool LPC1768_PWM_attach_pin(pin_t pin, uint32_t min /* = 1 */, uint32_t max /* = (LPC_PWM1_MR0 - 1) */, uint8_t servo_index /* = 0xff */) {
|
||||
bool LPC1768_PWM_attach_pin(pin_t pin, uint32_t min /* = 1 */, uint32_t max /* = (LPC_PWM1_MR0 - 1) */, uint8_t servo_index /* = 0xFF */) {
|
||||
|
||||
pin = GET_PIN_MAP_PIN(GET_PIN_MAP_INDEX(pin & 0xFF)); // Sometimes the upper byte is garbled
|
||||
|
||||
|
@ -79,7 +79,7 @@
|
||||
|
||||
#include <U8glib.h>
|
||||
|
||||
#define I2C_SLA (0x3c*2)
|
||||
#define I2C_SLA (0x3C*2)
|
||||
//#define I2C_CMD_MODE 0x080
|
||||
#define I2C_CMD_MODE 0x000
|
||||
#define I2C_DATA_MODE 0x040
|
||||
|
@ -68,7 +68,7 @@ void delayMicroseconds(uint32_t us);
|
||||
//void digitalWrite(int16_t pin, uint8_t pin_status);
|
||||
|
||||
|
||||
#define I2C_SLA (0x3c*2)
|
||||
#define I2C_SLA (0x3C*2)
|
||||
//#define I2C_CMD_MODE 0x080
|
||||
#define I2C_CMD_MODE 0x000
|
||||
#define I2C_DATA_MODE 0x040
|
||||
|
@ -87,16 +87,16 @@
|
||||
|
||||
if ( rs == 0 )
|
||||
/* command */
|
||||
spiSend(0x0f8);
|
||||
spiSend(0x0F8);
|
||||
else
|
||||
/* data */
|
||||
spiSend(0x0fa);
|
||||
spiSend(0x0FA);
|
||||
|
||||
for( i = 0; i < 4; i++ ) // give the controller some time to process the data
|
||||
u8g_10MicroDelay(); // 2 is bad, 3 is OK, 4 is safe
|
||||
}
|
||||
|
||||
spiSend(val & 0x0f0);
|
||||
spiSend(val & 0x0F0);
|
||||
spiSend(val << 4);
|
||||
}
|
||||
|
||||
|
@ -73,16 +73,16 @@
|
||||
|
||||
if ( rs == 0 )
|
||||
/* command */
|
||||
swSpiTransfer(0x0f8, SPI_speed, SCK_pin_ST7920_HAL, -1, MOSI_pin_ST7920_HAL_HAL);
|
||||
swSpiTransfer(0x0F8, SPI_speed, SCK_pin_ST7920_HAL, -1, MOSI_pin_ST7920_HAL_HAL);
|
||||
else
|
||||
/* data */
|
||||
swSpiTransfer(0x0fa, SPI_speed, SCK_pin_ST7920_HAL, -1, MOSI_pin_ST7920_HAL_HAL);
|
||||
swSpiTransfer(0x0FA, SPI_speed, SCK_pin_ST7920_HAL, -1, MOSI_pin_ST7920_HAL_HAL);
|
||||
|
||||
for( i = 0; i < 4; i++ ) // give the controller some time to process the data
|
||||
u8g_10MicroDelay(); // 2 is bad, 3 is OK, 4 is safe
|
||||
}
|
||||
|
||||
swSpiTransfer(val & 0x0f0, SPI_speed, SCK_pin_ST7920_HAL, -1, MOSI_pin_ST7920_HAL_HAL);
|
||||
swSpiTransfer(val & 0x0F0, SPI_speed, SCK_pin_ST7920_HAL, -1, MOSI_pin_ST7920_HAL_HAL);
|
||||
swSpiTransfer(val << 4, SPI_speed, SCK_pin_ST7920_HAL, -1, MOSI_pin_ST7920_HAL_HAL);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user