Skip to content

Commit a5a41d7

Browse files
committed
atmel-samd: Save a little space by tweaking error messages.
1 parent 8584f5f commit a5a41d7

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

atmel-samd/common-hal/nativeio/AnalogIn.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ void common_hal_nativeio_analogin_construct(nativeio_analogin_obj_t* self,
4646
const mcu_pin_obj_t *pin) {
4747
if (!pin->has_adc) {
4848
// No ADC function on that pin
49-
nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_ValueError, "pin %q does not have ADC capabilities", pin->name));
49+
nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, "Pin does not have ADC capabilities"));
5050
}
5151

5252
self->pin = pin;

atmel-samd/common-hal/nativeio/PWMOut.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,12 @@ void common_hal_nativeio_pwmout_construct(nativeio_pwmout_obj_t* self,
8080

8181
if (pin->primary_timer.tc == 0 && pin->secondary_timer.tc == 0) {
8282
nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_ValueError,
83-
"Invalid pin."));
83+
"Invalid pin"));
8484
}
8585

8686
if (frequency == 0 || frequency > 6000000) {
8787
nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_ValueError,
88-
"Invalid PWM frequency."));
88+
"Invalid PWM frequency"));
8989
}
9090

9191
uint16_t primary_timer_index = 0xff;
@@ -136,7 +136,7 @@ void common_hal_nativeio_pwmout_construct(nativeio_pwmout_obj_t* self,
136136
index = primary_timer_index;
137137
}
138138
if (t == NULL) {
139-
nlr_raise(mp_obj_new_exception_msg(&mp_type_OSError, "All timers in use."));
139+
nlr_raise(mp_obj_new_exception_msg(&mp_type_OSError, "All timers in use"));
140140
return;
141141
}
142142
uint8_t resolution = 0;
@@ -266,7 +266,7 @@ void common_hal_nativeio_pwmout_set_frequency(nativeio_pwmout_obj_t* self,
266266
uint32_t frequency) {
267267
if (frequency == 0 || frequency > 6000000) {
268268
nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_ValueError,
269-
"Invalid PWM frequency."));
269+
"Invalid PWM frequency"));
270270
}
271271
const pin_timer_t* t = self->timer;
272272
uint8_t resolution;

atmel-samd/common-hal/nativeio/SPI.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ void common_hal_nativeio_spi_construct(nativeio_spi_obj_t *self,
9292
}
9393
}
9494
if (sercom == NULL) {
95-
nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, "Invalid pins."));
95+
nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, "Invalid pins"));
9696
}
9797

9898
// Depends on where MOSI and CLK are.
@@ -111,7 +111,7 @@ void common_hal_nativeio_spi_construct(nativeio_spi_obj_t *self,
111111
}
112112
}
113113
if (dopo == 8) {
114-
nlr_raise(mp_obj_new_exception_msg(&mp_type_OSError, "SPI MOSI and clock pins incompatible."));
114+
nlr_raise(mp_obj_new_exception_msg(&mp_type_OSError, "SPI MOSI and clock pins incompatible"));
115115
}
116116

117117
config_spi_master.mux_setting = (dopo << SERCOM_SPI_CTRLA_DOPO_Pos) |

atmel-samd/common-hal/nativeio/UART.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ void common_hal_nativeio_uart_construct(nativeio_uart_obj_t *self,
162162
}
163163
}
164164
if (sercom == NULL) {
165-
nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, "Invalid pins."));
165+
nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, "Invalid pins"));
166166
}
167167
if (tx == NULL) {
168168
tx_pad = 0;

0 commit comments

Comments
 (0)