8000 Add code size analysis tool and shrink samd.clock a smidge. · adafruit/circuitpython@66b7972 · GitHub
[go: up one dir, main page]

Skip to content

Commit 66b7972

Browse files
committed
Add code size analysis tool and shrink samd.clock a smidge.
1 parent 769788d commit 66b7972

File tree

3 files changed

+460
-14
lines changed

3 files changed

+460
-14
lines changed

ports/atmel-samd/bindings/samd/Clock.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,7 @@
4747
STATIC void samd_clock_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) {
4848
samd_clock_obj_t *self = MP_OBJ_TO_PTR(self_in);
4949

50-
mp_printf(print, "%q.%q.%s(", MP_QSTR_samd, MP_QSTR_clock, self->name);
51-
if (clock_get_enabled(self->type, self->index)) {
52-
mp_printf(print, "frequency=%u", clock_get_frequency(self->type, self->index));
53-
uint32_t calibration = clock_get_calibration(self->type, self->index);
54-
if (calibration) {
55-
mp_printf(print, ", calibration=%u", calibration);
56-
}
57-
}
58-
mp_printf(print, ")");
50+
mp_printf(print, "%q.%q.%q", MP_QSTR_samd, MP_QSTR_clock, self->name);
5951
}
6052

6153
//| .. attribute:: enabled

ports/atmel-samd/bindings/samd/Clock.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,39 +31,39 @@
3131

3232
typedef struct {
3333
mp_obj_base_t base;
34-
const char *name;
34+
qstr name;
3535
uint8_t type;
3636
uint8_t index;
3737
} samd_clock_obj_t;
3838

3939
#define CLOCK(_name, _type, _index) \
4040
const samd_clock_obj_t clock_ ## _name = { \
4141
{ &samd_clock_type }, \
42-
.name = #_name, \
42+
.name = MP_QSTR_ ## _name, \
4343
.type = _type, \
4444
.index = _index, \
4545
}
4646

4747
#define CLOCK_SOURCE(_name) \
4848
const samd_clock_obj_t clock_ ## _name = { \
4949
{ &samd_clock_type }, \
50-
.name = #_name, \
50+
.name = MP_QSTR_ ## _name, \
5151
.type = 0, \
5252
.index = GCLK_SOURCE_ ## _name, \
5353
}
5454

5555
#define CLOCK_GCLK(_name) \
5656
const samd_clock_obj_t clock_ ## _name = { \
5757
{ &samd_clock_type }, \
58-
.name = #_name, \
58+
.name = MP_QSTR_ ## _name, \
5959
.type = 1, \
6060
.index = _name ## _GCLK_ID, \
6161
}
6262

6363
#define CLOCK_GCLK_(_name, _extra) \
6464
const samd_clock_obj_t clock_ ## _name ## _ ## _extra = { \
6565
{ &samd_clock_type }, \
66-
.name = #_name "_" #_extra, \
66+
.name = MP_QSTR_ ## _name ## _ ## _extra, \
6767
.type = 1, \
6868
.index = _name ## _GCLK_ID_ ## _extra, \
6969
}

0 commit comments

Comments
 (0)
0