10000 Fix attribution and revert changes to main · jun2sak/circuitpython@beb7e33 · GitHub
[go: up one dir, main page]

Skip to content

Commit beb7e33

Browse files
committed
Fix attribution and revert changes to main
1 parent 779169d commit beb7e33

File tree

10 files changed

+37
-28
lines changed

10 files changed

+37
-28
lines changed

main.c

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -404,8 +404,8 @@ STATIC bool run_code_py(safe_mode_t safe_mode) {
404404
new_status_color(BLACK);
405405
board_deinit();
406406
if (!supervisor_workflow_active()) {
407-
// Enter deep sleep. When we wake up we'll return from
408-
// this loop.
407+
// Enter true deep sleep. When we wake up we'll be back at the
408+
// top of main(), not in this loop.
409409
common_hal_alarm_enter_deep_sleep();
410410
// Does not return.
411411
} else {
@@ -426,18 +426,6 @@ STATIC bool run_code_py(safe_mode_t safe_mode) {
426426

427427
#if CIRCUITPY_ALARM
428428
common_hal_alarm_pretending_deep_sleep();
429-
bool serial_in = (serial_connected() &&
430-
serial_bytes_available());
431-
supervisor_set_run_reason(RUN_REASON_STARTUP);
432-
board_init();
433-
if (serial_in) {
434-
bool ctrl_d = serial_read() == CHAR_CTRL_D;
435-
if (ctrl_d) {
436-
supervisor_set_run_reason(RUN_REASON_REPL_RELOAD);
437-
}
438-
return ctrl_d;
439-
}
440-
return true;
441429
#else
442430
port_idle_until_interrupt();
443431
#endif

ports/nrf/common-hal/alarm/SleepMemory.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
*
44
* The MIT License (MIT)
55
*
6-
* Copyright (c) 2020 microDev
7-
* Copyright (c) 2020 Dan Halbert for Adafruit Industries
6+
* Copyright (c) 2021 Jun2Sak
87
*
98
* Permission is hereby granted, free of charge, to any person obtaining a copy
109
* of this software and associated documentation files (the "Software"), to deal

ports/nrf/common-hal/alarm/SleepMemory.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* The MIT License (MIT)
55
*
6-
* Copyright (c) 2020 Dan Halbert for Adafruit Industries
6+
* Copyright (c) 2021 Jun2Sak
77
*
88
* Permission is hereby granted, free of charge, to any person obtaining a copy
99
* of this software and associated documentation files (the "Software"), to deal

ports/nrf/common-hal/alarm/__init__.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
*
44
* The MIT License (MIT)
55
*
6-
* Copyright (c) 2020 Scott Shawcroft for Adafruit Industries
7-
* Copyright (c) 2020 Dan Halbert for Adafruit Industries
6+
* Copyright (c) 2021 Jun2Sak
87
*
98
* Permission is hereby granted, free of charge, to any person obtaining a copy
109
* of this software and associated documentation files (the "Software"), to deal
@@ -167,6 +166,9 @@ STATIC void _setup_sleep_alarms(bool deep_sleep, size_t n_alarms, const mp_obj_t
167166
alarm_touch_touchalarm_set_alarm(deep_sleep, n_alarms, alarms);
168167
}
169168

169+
// TODO: this handles all possible types of wakeup, which is redundant with main.
170+
// revise to extract all parts essential to enabling sleep wakeup, but leave the
171+
// alarm/non-alarm sorting to the existing main loop.
170172
nrf_sleep_source_t system_on_idle_until_alarm(int64_t timediff_ms, uint32_t prescaler) {
171173
bool have_timeout = false;
172174
uint64_t start_tick = 0, end_tick = 0;
@@ -382,7 +384,7 @@ void common_hal_alarm_pretending_deep_sleep(void) {
382384
print_wakeup_cause(cause);
383385
#endif
384386

385-
alarm_reset();
387+
// alarm_reset();
386388

387389
#if 0
388390
// if one of Alarm event occurred, reset myself

ports/nrf/common-hal/alarm/__init__.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* The MIT License (MIT)
55
*
6-
* Copyright (c) 2020 Dan Halbert for Adafruit Industries.
6+
* Copyright (c) 2021 Jun2Sak
77
*
88
* Permission is hereby granted, free of charge, to any person obtaining a copy
99
* of this software and associated documentation files (the "Software"), to deal

ports/nrf/common-hal/alarm/pin/PinAlarm.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
*
44
* The MIT License (MIT)
55
*
6-
* Copyright (c) 2020 Dan Halbert for Adafruit Industries
7-
* Copyright (c) 2020 Scott Shawcroft for Adafruit Industries
6+
* Copyright (c) 2021 Jun2Sak
87
*
98
* Permission is hereby granted, free of charge, to any person obtaining a copy
109
* of this software and associated documentation files (the "Software"), to deal

ports/nrf/common-hal/alarm/pin/PinAlarm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* The MIT License (MIT)
55
*
6-
* Copyright (c) 2020 Dan Halbert for Adafruit Industries
6+
* Copyright (c) 2021 Jun2Sak
77
*
88
* Permission is hereby granted, free of charge, to any person obtaining a copy
99
* of this software and associated documentation files (the "Software"), to deal

ports/nrf/common-hal/alarm/time/TimeAlarm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* The MIT License (MIT)
55
*
6-
* Copyright (c) 2020 Dan Halbert for Adafruit Industries
6+
* Copyright (c) 2021 Jun2Sak
77
*
88
* Permission is hereby granted, free of charge, to any person obtaining a copy
99
* of this software and associated documentation files (the "Software"), to deal

ports/nrf/common-hal/alarm/time/TimeAlarm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* The MIT License (MIT)
55
*
6-
* Copyright (c) 2020 Dan Halbert for Adafruit Industries
6+
* Copyright (c) 2021 Jun2Sak
77
*
88
* Permission is hereby granted, free of charge, to any person obtaining a copy
99
* of this software and associated documentation files (the "Software"), to deal

ports/nrf/supervisor/debug_uart.c

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,27 @@
11
/*
2-
* debug functions
3-
* (will be removed)
2+
* This file is part of the MicroPython project, http://micropython.org/
3+
*
4+
* The MIT License (MIT)
5+
*
6+
* Copyright (c) 2021 Jun2Sak
7+
*
8+
* Permission is hereby granted, free of charge, to any person obtaining a copy
9+
* of this software and associated documentation files (the "Software"), to deal
10+
* in the Software without restriction, including without limitation the rights
11+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12+
* copies of the Software, and to permit persons to whom the Software is
13+
* furnished to do so, subject to the following conditions:
14+
*
15+
* The above copyright notice and this permission notice shall be included in
16+
* all copies or substantial portions of the Software.
17+
*
18+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24+
* THE SOFTWARE.
425
*/
526

627
#include <stdio.h>

0 commit comments

Comments
 (0)
0