generated from hulk/gd32e23x_template
LDC1612单次读取16bit正常,可以获取厂商ID或者设备ID,但是无法连续获取
This commit is contained in:
parent
dbff482cf3
commit
f5e804db39
13
src/main.c
13
src/main.c
@ -12,8 +12,7 @@
|
|||||||
#include "RS485.h"
|
#include "RS485.h"
|
||||||
#include "LDC1612.h"
|
#include "LDC1612.h"
|
||||||
|
|
||||||
void led_config(void)
|
void led_config(void) {
|
||||||
{
|
|
||||||
rcu_periph_clock_enable(LED_RCU);
|
rcu_periph_clock_enable(LED_RCU);
|
||||||
|
|
||||||
gpio_mode_set(LED_PORT, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, LED_PIN);
|
gpio_mode_set(LED_PORT, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, LED_PIN);
|
||||||
@ -80,12 +79,10 @@ int main(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* retarget the C library printf function to the USART */
|
/* retarget the C library printf function to the USART */
|
||||||
int _write (int fd, char *pBuffer, int size)
|
int _write(int fd, char *pBuffer, int size) {
|
||||||
{
|
for (int i = 0; i < size; i++) {
|
||||||
for (int i = 0; i < size; i++)
|
usart_data_transmit(USART0, (uint8_t) pBuffer[i]);
|
||||||
{
|
while (RESET == usart_flag_get(USART0, USART_FLAG_TBE));
|
||||||
usart_data_transmit(USART0, (uint8_t)pBuffer[i]);
|
|
||||||
while(RESET == usart_flag_get(USART0, USART_FLAG_TBE));
|
|
||||||
}
|
}
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user