8000 add copyright notice. remove obsolete comments. · jun2sak/circuitpython@a17fcb6 · GitHub
[go: up one dir, main page]

Skip to content

Commit a17fcb6

Browse files
committed
add copyright notice. remove obsolete comments.
1 parent 6e9429d commit a17fcb6

File tree

6 files changed

+13
-19
lines changed

6 files changed

+13
-19
lines changed

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

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*
66
* Copyright (c) 2020 Scott Shawcroft for Adafruit Industries
77
* Copyright (c) 2020 Dan Halbert for Adafruit Industries
8+
* Copyright (c) 2021 Junji Sakai
89
*
910
* Permission is hereby granted, free of charge, to any person obtaining a copy
1011
* of this software and associated documentation files (the "Software"), to deal
@@ -119,11 +120,6 @@ bool common_hal_alarm_woken_from_sleep(void) {
119120

120121
nrf_sleep_source_t alarm_woken_from_sleep_2(void) {
121122
nrf_sleep_source_t cause = _get_wakeup_cause();
122-
#ifdef NRF_DEBUG_PRINT
123-
if (cause != NRF_SLEEP_WAKEUP_UNDEFINED) {
124-
//print_wakeup_cause(cause);
125-
}
126-
#endif
127123
if (cause == NRF_SLEEP_WAKEUP_GPIO ||
128124
cause == NRF_SLEEP_WAKEUP_TIMER ||
129125
cause == NRF_SLEEP_WAKEUP_TOUCHPAD) {
@@ -136,9 +132,6 @@ nrf_sleep_source_t alarm_woken_from_sleep_2(void) {
136132

137133
STATIC mp_obj_t _get_wake_alarm(size_t n_alarms, const mp_obj_t *alarms) {
138134
nrf_sleep_source_t cause = _get_wakeup_cause();
139-
#ifdef NRF_DEBUG_PRINT
140-
//print_wakeup_cause(cause);
141-
#endif
142135
switch (cause) {
143136
case NRF_SLEEP_WAKEUP_TIMER: {
144137
return alarm_time_timealarm_get_wakeup_alarm(n_alarms, alarms);
@@ -264,16 +257,16 @@ nrf_sleep_source_t system_on_idle_until_alarm(int64_t timediff_ms, uint32_t pres
264257
qspi_flash_exit_sleep();
265258
#endif
266259

260+
#ifdef NRF_DEBUG_PRINT
267261
tickdiff = port_get_raw_ticks(NULL) - start_tick;
262+
double sec;
268263
if (prescaler == 0) {
269-
timediff_ms = tickdiff / 1024;
264+
sec = (double)tickdiff / 1024;
270265
}
271266
else {
272-
timediff_ms = tickdiff * prescaler / 1024;
267+
sec = (double)(tickdiff * prescaler) / 1024;
273268
}
274-
(void)timediff_ms;
275-
#ifdef NRF_DEBUG_PRINT
276-
dbg_printf("lapse %6.1f sec\r\n", (double)(timediff_ms));
269+
dbg_printf("lapse %6.1f sec\r\n", sec);
277270
#endif
278271

279272
return wakeup_cause;

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* The MIT License (MIT)
55
*
66
* Copyright (c) 2020 Dan Halbert for Adafruit Industries.
7+
* Copyright (c) 2021 Junji Sakai
78
*
89
* Permission is hereby granted, free of charge, to any person obtaining a copy
910
* of this software and associated documentation files (the "Software"), to deal

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*
66
* Copyright (c) 2020 Dan Halbert for Adafruit Industries
77
* Copyright (c) 2020 Scott Shawcroft for Adafruit Industries
8+
* Copyright (c) 2021 Junji Sakai
89
*
910
* Permission is hereby granted, free of charge, to any person obtaining a copy
1011
* of this software and associated documentation files (the "Software"), to deal

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* The MIT License (MIT)
55
*
66
* Copyright (c) 2020 Dan Halbert for Adafruit Industries
7+
* Copyright (c) 2021 Junji Sakai
78
*
89
* Permission is hereby granted, free of charge, to any person obtaining a copy
910
* of this software and associated documentation files (the "Software"), to deal
@@ -24,10 +25,7 @@
2425
* THE SOFTWARE.
2526
*/
2627

27-
//#include "esp_sleep.h"
28-
2928
#include "py/runtime.h"
30-
//#include "supervisor/esp_port.h"
3129
#include <stdio.h>
3230

3331
#include "common-hal/alarm/__init__.h"

ports/nrf/supervisor/port.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* The MIT License (MIT)
55
*
66
* Copyright (c) 2017 Scott Shawcroft for Adafruit Industries
7+
* Copyright (c) 2021 Junji Sakai
78
*
89
* Permission is hereby granted, free of charge, to any person obtaining a copy
910
* of this software and associated documentation files (the "Software"), to deal

supervisor/shared/serial.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
#ifdef NRF_DEBUG_PRINT
4040
// XXX these functions are in nrf/supervisor/debug_uart.c
4141
extern void _debug_uart_init(void);
42-
extern void _debug_print_substr(const char* text, uint32_t length);
42+
extern void _debug_print_substr(const char *text, uint32_t length);
4343
#endif
4444

4545
/*
@@ -71,7 +71,7 @@ void serial_early_init(void) {
7171
#endif
7272

7373
#ifdef NRF_DEBUG_PRINT
74-
_debug_uart_init();
74+
_debug_uart_init();
7575
#endif
7676
}
7777

@@ -155,7 +155,7 @@ void serial_write_substring(const char *text, uint32_t length) {
155155
#if defined(DEBUG_UART_TX) && defined(DEBUG_UART_RX)
156156
int uart_errcode;
157157

158-
common_hal_busio_uart_write(&debug_uart, (const uint8_t*) text, length, &uart_errcode);
158+
common_hal_busio_uart_write(&debug_uart, (const uint8_t *) text, length, &uart_errcode);
159159
#endif
160160

161161
#ifdef NRF_DEBUG_PRINT

0 commit comments

Comments
 (0)
0