File tree Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -40,9 +40,9 @@ supervisor_allocation* usb_midi_allocation;
40
40
41
41
void usb_midi_init (void ) {
42
42
// TODO(tannewt): Make this dynamic.
43
- uint16_t tuple_size = align32_size (sizeof (mp_obj_tuple_t ) + sizeof (mp_obj_t * ) * 2 );
44
- uint16_t portin_size = align32_size (sizeof (usb_midi_portin_obj_t ));
45
- uint16_t portout_size = align32_size (sizeof (usb_midi_portout_obj_t ));
43
+ size_t tuple_size = align32_size (sizeof (mp_obj_tuple_t ) + sizeof (mp_obj_t * ) * 2 );
44
+ size_t portin_size = align32_size (sizeof (usb_midi_portin_obj_t ));
45
+ size_t portout_size = align32_size (sizeof (usb_midi_portout_obj_t ));
46
46
47
47
// For each embedded MIDI Jack in the descriptor we create a Port
48
48
usb_midi_allocation = allocate_memory (tuple_size + portin_size + portout_size , false, false);
Original file line number Diff line number Diff line change @@ -64,11 +64,8 @@ supervisor_allocation* allocate_remaining_memory(void);
64
64
// supervisor_move_memory().
65
65
supervisor_allocation * allocate_memory (uint32_t length , bool high_address , bool movable );
66
66
67
- static inline uint16_t align32_size (uint16_t size ) {
68
- if (size % 4 != 0 ) {
69
- return (size & 0xfffc ) + 0x4 ;
70
- }
71
- return size ;
67
+ static inline size_t align32_size (size_t size ) {
68
+ return (size + 3 ) & ~3 ;
72
69
}
73
70
74
71
size_t get_allocation_length (supervisor_allocation * allocation );
You can’t perform that action at this time.
0 commit comments