summaryrefslogtreecommitdiff
path: root/ports
diff options
context:
space:
mode:
Diffstat (limited to 'ports')
-rw-r--r--ports/atmel-samd/mpconfigport.mk4
-rw-r--r--ports/nrf/bluetooth/ble_uart.c4
-rwxr-xr-xports/nrf/common-hal/supervisor/Runtime.c14
-rw-r--r--ports/nrf/supervisor/serial.c10
-rw-r--r--ports/raspberrypi/common-hal/pwmio/PWMOut.c2
5 files changed, 11 insertions, 23 deletions
diff --git a/ports/atmel-samd/mpconfigport.mk b/ports/atmel-samd/mpconfigport.mk
index 9839a2aa4..e47acfb36 100644
--- a/ports/atmel-samd/mpconfigport.mk
+++ b/ports/atmel-samd/mpconfigport.mk
@@ -49,9 +49,9 @@ CIRCUITPY_SDCARDIO ?= 0
CIRCUITPY_FRAMEBUFFERIO ?= 0
# SAMD21 needs separate endpoint pairs for MSC BULK IN and BULK OUT, otherwise it's erratic.
-# Because of that, there aren't enough endpoints for serial2.
+# Because of that, there aren't enough endpoints for a secondary CDC serial connection.
USB_MSC_EP_NUM_OUT = 1
-CIRCUITPY_USB_SERIAL2 = 0
+CIRCUITPY_USB_CDC = 0
CIRCUITPY_ULAB = 0
diff --git a/ports/nrf/bluetooth/ble_uart.c b/ports/nrf/bluetooth/ble_uart.c
index 1e7a319bd..1b87b82d1 100644
--- a/ports/nrf/bluetooth/ble_uart.c
+++ b/ports/nrf/bluetooth/ble_uart.c
@@ -40,7 +40,7 @@
#include "shared-bindings/_bleio/Service.h"
#include "shared-bindings/_bleio/UUID.h"
-#if CIRCUITPY_SERIAL_BLE
+#if CIRCUITPY_REPL_BLE
static const char default_name[] = "CP-REPL"; // max 8 chars or uuid won't fit in adv data
static const char NUS_UUID[] = "6e400001-b5a3-f393-e0a9-e50e24dcca9e";
@@ -190,4 +190,4 @@ void mp_hal_stdout_tx_strn(const char *str, size_t len) {
}
}
-#endif // CIRCUITPY_SERIAL_BLE
+#endif // CIRCUITPY_REPL_BLE
diff --git a/ports/nrf/common-hal/supervisor/Runtime.c b/ports/nrf/common-hal/supervisor/Runtime.c
index a8f50f70e..def609cda 100755
--- a/ports/nrf/common-hal/supervisor/Runtime.c
+++ b/ports/nrf/common-hal/supervisor/Runtime.c
@@ -35,17 +35,3 @@ bool common_hal_supervisor_runtime_get_serial_connected(void) {
bool common_hal_get_supervisor_runtime_serial_bytes_available(void) {
return (bool) serial_bytes_available();
}
-
-#if CIRCUITPY_USB_SERIAL2
-mp_obj_t common_hal_supervisor_runtime_get_serial2(void) {
- return (bool) serial_connected();
-}
-
-bool common_hal_supervisor_runtime_get_serial2_connected(void) {
- return (bool) serial_connected();
-}
-
-bool common_hal_get_supervisor_runtime_serial2_bytes_available(void) {
- return (bool) serial_bytes_available();
-}
-#endif
diff --git a/ports/nrf/supervisor/serial.c b/ports/nrf/supervisor/serial.c
index b19e9267c..2c2c0116f 100644
--- a/ports/nrf/supervisor/serial.c
+++ b/ports/nrf/supervisor/serial.c
@@ -28,15 +28,15 @@
#include "supervisor/serial.h"
-#if CIRCUITPY_SERIAL_BLE
+#if CIRCUITPY_REPL_BLE
#include "ble_uart.h"
-#elif CIRCUITPY_SERIAL_UART
+#elif CIRCUITPY_REPL_UART
#include <string.h>
#include "nrf_gpio.h"
#include "nrfx_uarte.h"
#endif
-#if CIRCUITPY_SERIAL_BLE
+#if CIRCUITPY_REPL_BLE
void serial_init(void) {
ble_uart_init();
@@ -58,7 +58,7 @@ void serial_write(const char *text) {
ble_uart_stdout_tx_str(text);
}
-#elif CIRCUITPY_SERIAL_UART
+#elif CIRCUITPY_REPL_UART
uint8_t serial_received_char;
nrfx_uarte_t serial_instance = NRFX_UARTE_INSTANCE(0);
@@ -124,4 +124,4 @@ void serial_write_substring(const char *text, uint32_t len) {
}
}
-#endif // CIRCUITPY_SERIAL_UART
+#endif // CIRCUITPY_REPL_UART
diff --git a/ports/raspberrypi/common-hal/pwmio/PWMOut.c b/ports/raspberrypi/common-hal/pwmio/PWMOut.c
index 3d8979a03..799ee887f 100644
--- a/ports/raspberrypi/common-hal/pwmio/PWMOut.c
+++ b/ports/raspberrypi/common-hal/pwmio/PWMOut.c
@@ -164,6 +164,7 @@ void common_hal_pwmio_pwmout_deinit(pwmio_pwmout_obj_t* self) {
extern void common_hal_pwmio_pwmout_set_duty_cycle(pwmio_pwmout_obj_t* self, uint16_t duty) {
self->duty_cycle = duty;
uint16_t actual_duty = duty * self->top / ((1 << 16) - 1);
+ mp_printf(&mp_plat_print, "actual_duty: %d, self->top: %d\n", actual_duty, top); /// ***
pwm_set_chan_level(self->slice, self->channel, actual_duty);
}
@@ -200,6 +201,7 @@ void common_hal_pwmio_pwmout_set_frequency(pwmio_pwmout_obj_t* self, uint32_t fr
} else {
uint32_t top = common_hal_mcu_processor_get_frequency() / frequency;
self->actual_frequency = common_hal_mcu_processor_get_frequency() / top;
+ mp_printf(&mp_plat_print, "high speed self->top: %d\n", top); /// ***
self->top = top;
pwm_set_clkdiv_int_frac(self->slice, 1, 0);
pwm_set_wrap(self->slice, self->top - 1);