samd: Make ADC, DAC, PWM, SPI objects consistent in how they print out.
All of ADC, DAC, Pin, PWM and SPI looked different before this change.
This commit is contained in:
parent
e5cf3fab95
commit
4d38ab652e
@ -66,7 +66,7 @@ STATIC void adc_obj_print(const mp_print_t *print, mp_obj_t o, mp_print_kind_t k
|
||||
(void)kind;
|
||||
machine_adc_obj_t *self = MP_OBJ_TO_PTR(o);
|
||||
|
||||
mp_printf(print, "ADC(%s, ADC%u, channel=%u, bits=%u, average=%u)",
|
||||
mp_printf(print, "ADC(%s, device=%u, channel=%u, bits=%u, average=%u)",
|
||||
pin_name(self->id), self->adc_config.device,
|
||||
self->adc_config.channel, self->bits, 1 << self->avg);
|
||||
}
|
||||
|
@ -126,7 +126,7 @@ STATIC mp_obj_t dac_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_
|
||||
|
||||
STATIC void dac_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) {
|
||||
dac_obj_t *self = self_in;
|
||||
mp_printf(print, "DAC(%u) PIN_PA%02u", self->id, self->gpio_id);
|
||||
mp_printf(print, "DAC(%u, Pin=%s)", self->id, pin_name(self->gpio_id));
|
||||
}
|
||||
|
||||
STATIC mp_obj_t dac_write(mp_obj_t self_in, mp_obj_t value_in) {
|
||||
|
@ -107,7 +107,7 @@ STATIC void mp_machine_pwm_duty_set_ns(machine_pwm_obj_t *self, mp_int_t duty_ns
|
||||
|
||||
STATIC void mp_machine_pwm_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) {
|
||||
machine_pwm_obj_t *self = MP_OBJ_TO_PTR(self_in);
|
||||
mp_printf(print, "PWM %s device=%u channel=%u output=%u",
|
||||
mp_printf(print, "PWM(%s, device=%u, channel=%u, output=%u)",
|
||||
pin_name(self->pin_id), self->device, self->channel, self->output);
|
||||
}
|
||||
|
||||
|
@ -82,7 +82,7 @@ void common_spi_irq_handler(int spi_id) {
|
||||
|
||||
STATIC void machine_spi_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) {
|
||||
machine_spi_obj_t *self = MP_OBJ_TO_PTR(self_in);
|
||||
mp_printf(print, "SPI(%u), baudrate=%u, firstbit=%u, polarity=%u, phase=%u, bits=8",
|
||||
mp_printf(print, "SPI(%u, baudrate=%u, firstbit=%u, polarity=%u, phase=%u, bits=8)",
|
||||
self->id, self->baudrate, self->firstbit, self->polarity, self->phase);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user