Skip to content

Commit 7672bf7

Browse files
committed
atmel-samd: Rename auto-reset to auto-reload to reduce confusion with physical reset buttons.
1 parent e0f931a commit 7672bf7

File tree

18 files changed

+73
-87
lines changed

18 files changed

+73
-87
lines changed

atmel-samd/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ SRC_ASF = $(addprefix asf/sam0/,\
180180

181181
SRC_C = \
182182
access_vfs.c \
183-
autoreset.c \
183+
autoreload.c \
184184
builtin_open.c \
185185
fatfs_port.c \
186186
main.c \

atmel-samd/access_vfs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#include <string.h>
2828

2929
#include "access_vfs.h"
30-
#include "autoreset.h"
30+
#include "autoreload.h"
3131

3232
#include "asf/common/services/usb/class/msc/device/udi_msc.h"
3333
#include "extmod/fsusermount.h"
@@ -184,6 +184,6 @@ Ctrl_status vfs_usb_write_10(uint32_t addr, volatile uint16_t nb_sector)
184184
}
185185
}
186186
}
187-
autoreset_start();
187+
autoreload_start();
188188
return CTRL_GOOD;
189189
}

atmel-samd/autoreset.c renamed to atmel-samd/autoreload.c

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -24,44 +24,44 @@
2424
* THE SOFTWARE.
2525
*/
2626

27-
#include "autoreset.h"
27+
#include "autoreload.h"
2828

2929
#include "asf/sam0/drivers/tc/tc_interrupt.h"
3030
#include "lib/utils/interrupt_char.h"
3131
#include "py/mphal.h"
3232

33-
volatile uint32_t autoreset_delay_ms = 0;
34-
bool autoreset_enabled = false;
35-
volatile bool reset_next_character = false;
33+
volatile uint32_t autoreload_delay_ms = 0;
34+
bool autoreload_enabled = false;
35+
volatile bool reload_next_character = false;
3636

37-
inline void autoreset_tick() {
38-
if (autoreset_delay_ms == 0) {
37+
inline void autoreload_tick() {
38+
if (autoreload_delay_ms == 0) {
3939
return;
4040
}
41-
if (autoreset_delay_ms == 1 && autoreset_enabled && !reset_next_character) {
41+
if (autoreload_delay_ms == 1 && autoreload_enabled && !reload_next_character) {
4242
mp_keyboard_interrupt();
43-
reset_next_character = true;
43+
reload_next_character = true;
4444
}
45-
autoreset_delay_ms--;
45+
autoreload_delay_ms--;
4646
}
4747

48-
void autoreset_enable() {
49-
autoreset_enabled = true;
50-
reset_next_character = false;
48+
void autoreload_enable() {
49+
autoreload_enabled = true;
50+
reload_next_character = false;
5151
}
5252

53-
void autoreset_disable() {
54-
autoreset_enabled = false;
53+
void autoreload_disable() {
54+
autoreload_enabled = false;
5555
}
5656

57-
inline bool autoreset_is_enabled() {
58-
return autoreset_enabled;
57+
inline bool autoreload_is_enabled() {
58+
return autoreload_enabled;
5959
}
6060

61-
void autoreset_start() {
62-
autoreset_delay_ms = AUTORESET_DELAY_MS;
61+
void autoreload_start() {
62+
autoreload_delay_ms = CIRCUITPY_AUTORELOAD_DELAY_MS;
6363
}
6464

65-
void autoreset_stop() {
66-
autoreset_delay_ms = 0;
65+
void autoreload_stop() {
66+
autoreload_delay_ms = 0;
6767
}

atmel-samd/autoreset.h renamed to atmel-samd/autoreload.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,19 @@
2424
* THE SOFTWARE.
2525
*/
2626

27-
#ifndef __MICROPY_INCLUDED_ATMEL_SAMD_AUTORESET_H__
28-
#define __MICROPY_INCLUDED_ATMEL_SAMD_AUTORESET_H__
27+
#ifndef __MICROPY_INCLUDED_ATMEL_SAMD_AUTORELOAD_H__
28+
#define __MICROPY_INCLUDED_ATMEL_SAMD_AUTORELOAD_H__
2929

3030
#include <stdbool.h>
3131

32-
extern volatile bool reset_next_character;
32+
extern volatile bool reload_next_character;
3333

34-
void autoreset_tick(void);
34+
void autoreload_tick(void);
3535

36-
void autoreset_start(void);
37-
void autoreset_stop(void);
38-
void autoreset_enable(void);
39-
void autoreset_disable(void);
40-
bool autoreset_is_enabled(void);
36+
void autoreload_start(void);
37+
void autoreload_stop(void);
38+
void autoreload_enable(void);
39+
void autoreload_disable(void);
40+
bool autoreload_is_enabled(void);
4141

42-
#endif // __MICROPY_INCLUDED_ATMEL_SAMD_AUTORESET_H__
42+
#endif // __MICROPY_INCLUDED_ATMEL_SAMD_AUTORELOAD_H__

atmel-samd/bindings/samd/__init__.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
*/
2626
#include "py/obj.h"
2727
#include "py/runtime.h"
28-
#include "autoreset.h"
28+
#include "autoreload.h"
2929

3030
//| :mod:`samd` --- SAMD implementation settings
3131
//| =================================================
@@ -35,31 +35,31 @@
3535
//| :platform: SAMD21
3636
//|
3737

38-
//| .. method:: enable_autoreset()
38+
//| .. method:: enable_autoreload()
3939
//|
40-
//| Enable autoreset based on USB file write activity.
40+
//| Enable autoreload based on USB file write activity.
4141
//|
42-
STATIC mp_obj_t samd_enable_autoreset(void) {
43-
autoreset_enable();
42+
STATIC mp_obj_t samd_enable_autoreload(void) {
43+
autoreload_enable();
4444
return mp_const_none;
4545
}
46-
MP_DEFINE_CONST_FUN_OBJ_0(samd_enable_autoreset_obj, samd_enable_autoreset);
46+
MP_DEFINE_CONST_FUN_OBJ_0(samd_enable_autoreload_obj, samd_enable_autoreload);
4747

48-
//| .. method:: disable_autoreset()
48+
//| .. method:: disable_autoreload()
4949
//|
50-
//| Disable autoreset based on USB file write activity until the next reset
51-
//| or until `enable_autoreset` is called.
50+
//| Disable autoreload based on USB file write activity until the next reload
51+
//| or until `enable_autoreload` is called.
5252
//|
53-
STATIC mp_obj_t samd_disable_autoreset(void) {
54-
autoreset_disable();
53+
STATIC mp_obj_t samd_disable_autoreload(void) {
54+
autoreload_disable();
5555
return mp_const_none;
5656
}
57-
MP_DEFINE_CONST_FUN_OBJ_0(samd_disable_autoreset_obj, samd_disable_autoreset);
57+
MP_DEFINE_CONST_FUN_OBJ_0(samd_disable_autoreload_obj, samd_disable_autoreload);
5858

5959
STATIC const mp_rom_map_elem_t samd_module_globals_table[] = {
6060
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_samd) },
61-
{ MP_OBJ_NEW_QSTR(MP_QSTR_enable_autoreset), MP_ROM_PTR(&samd_enable_autoreset_obj)},
62-
{ MP_OBJ_NEW_QSTR(MP_QSTR_disable_autoreset), MP_ROM_PTR(&samd_disable_autoreset_obj)},
61+
{ MP_OBJ_NEW_QSTR(MP_QSTR_enable_autoreload), MP_ROM_PTR(&samd_enable_autoreload_obj)},
62+
{ MP_OBJ_NEW_QSTR(MP_QSTR_disable_autoreload), MP_ROM_PTR(&samd_disable_autoreload_obj)},
6363
};
6464

6565
STATIC MP_DEFINE_CONST_DICT(samd_module_globals, samd_module_globals_table);

atmel-samd/boards/arduino_zero/mpconfigboard.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
#define MICROPY_PORT_A (PORT_PA24 | PORT_PA25 | PORT_PA27)
1111
#define MICROPY_PORT_B (PORT_PB03)
1212

13-
#define AUTORESET_DELAY_MS 500
14-
1513
#include "internal_flash.h"
1614

1715
#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000)

atmel-samd/boards/circuitplayground_express/mpconfigboard.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@
3232

3333
#define SPEAKER_ENABLE_PIN (&pin_PA30)
3434

35-
#define AUTORESET_DELAY_MS 500
36-
3735
#include "spi_flash.h"
3836

3937
#define BOARD_FLASH_SIZE (0x00040000 - 0x2000)

atmel-samd/boards/feather_m0_adalogger/mpconfigboard.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
#define MICROPY_HW_BOARD_NAME "Adafruit Feather M0 Adalogger"
77
#define MICROPY_HW_MCU_NAME "samd21g18"
88

9-
#define AUTORESET_DELAY_MS 500
10-
119
#define MICROPY_PORT_A (PORT_PA24 | PORT_PA25)
1210
#define MICROPY_PORT_B (0)
1311

atmel-samd/boards/feather_m0_basic/mpconfigboard.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
#define MICROPY_HW_BOARD_NAME "Adafruit Feather M0 Basic"
77
#define MICROPY_HW_MCU_NAME "samd21g18"
88

9-
#define AUTORESET_DELAY_MS 500
10-
119
#define MICROPY_PORT_A (PORT_PA24 | PORT_PA25)
1210
#define MICROPY_PORT_B (0)
1311

atmel-samd/boards/feather_m0_express/mpconfigboard.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121
#define MICROPY_PORT_A (PORT_PA06 | PORT_PA08 | PORT_PA09 | PORT_PA14 | PORT_PA13 | PORT_PA14 | PORT_PA24 | PORT_PA25)
2222
#define MICROPY_PORT_B ( 0 )
2323

24-
#define AUTORESET_DELAY_MS 500
25-
2624
#include "spi_flash.h"
2725

2826
#define BOARD_FLASH_SIZE (0x00040000 - 0x2000)

0 commit comments

Comments
 (0)