Skip to content

Commit 4af2665

Browse files
authored
Merge pull request vedderb#252 from Jfriesen222/dev_fw_5_03
Some changes to UART driver to make it indexed
2 parents b412ac3 + cf8c16f commit 4af2665

12 files changed

+287
-311
lines changed

applications/app.c

+7-6
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ void app_set_configuration(app_configuration *conf) {
5151

5252
app_ppm_stop();
5353
app_adc_stop();
54-
app_uartcomm_stop();
54+
app_uartcomm_stop(0);
5555
app_nunchuk_stop();
5656
app_balance_stop();
5757
app_pas_stop();
@@ -84,19 +84,19 @@ void app_set_configuration(app_configuration *conf) {
8484

8585
case APP_UART:
8686
hw_stop_i2c();
87-
app_uartcomm_start();
87+
app_uartcomm_start(0);
8888
break;
8989

9090
case APP_PPM_UART:
9191
hw_stop_i2c();
9292
app_ppm_start();
93-
app_uartcomm_start();
93+
app_uartcomm_start(0);
9494
break;
9595

9696
case APP_ADC_UART:
9797
hw_stop_i2c();
9898
app_adc_start(false);
99-
app_uartcomm_start();
99+
app_uartcomm_start(0);
100100
break;
101101

102102
case APP_NUNCHUK:
@@ -107,7 +107,7 @@ void app_set_configuration(app_configuration *conf) {
107107
app_balance_start();
108108
if(appconf.imu_conf.type == IMU_TYPE_INTERNAL){
109109
hw_stop_i2c();
110-
app_uartcomm_start();
110+
app_uartcomm_start(0);
111111
}
112112
break;
113113

@@ -141,7 +141,8 @@ void app_set_configuration(app_configuration *conf) {
141141
app_ppm_configure(&appconf.app_ppm_conf);
142142
app_adc_configure(&appconf.app_adc_conf);
143143
app_pas_configure(&appconf.app_pas_conf);
144-
app_uartcomm_configure(appconf.app_uart_baudrate, appconf.permanent_uart_enabled);
144+
app_uartcomm_configure(appconf.app_uart_baudrate, true, 0);
145+
app_uartcomm_configure(0, appconf.permanent_uart_enabled, 1);
145146
app_nunchuk_configure(&appconf.app_chuk_conf);
146147

147148
#ifdef APP_CUSTOM_TO_USE

applications/app.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ float app_adc_get_voltage(void);
4343
float app_adc_get_decoded_level2(void);
4444
float app_adc_get_voltage2(void);
4545

46-
void app_uartcomm_start(void);
47-
void app_uartcomm_start_permanent(void);
48-
void app_uartcomm_stop(void);
49-
void app_uartcomm_configure(uint32_t baudrate, bool permanent_enabled);
50-
void app_uartcomm_send_packet(unsigned char *data, unsigned int len);
46+
void app_uartcomm_initialize(void);
47+
void app_uartcomm_start(unsigned int port_number);
48+
void app_uartcomm_stop(unsigned int port_number);
49+
void app_uartcomm_configure(uint32_t baudrate, bool permanent_enabled, unsigned int port_number);
50+
void app_uartcomm_send_packet(unsigned char *data, unsigned int len, unsigned int port_number);
5151
void app_uartcomm_send_packet_p(unsigned char *data, unsigned int len);
5252

5353
void app_nunchuk_start(void);

0 commit comments

Comments
 (0)