Skip to content

Commit b9dad0a

Browse files
committed
stm32: Remove commented-out printf's and debugging code.
Signed-off-by: Damien George <[email protected]>
1 parent 7c1584a commit b9dad0a

File tree

6 files changed

+0
-55
lines changed

6 files changed

+0
-55
lines changed

ports/stm32/gccollect.c

-21
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,13 @@
2424
* THE SOFTWARE.
2525
*/
2626

27-
#include <stdio.h>
28-
#include <stdint.h>
29-
30-
#include "py/mpstate.h"
3127
#include "py/gc.h"
3228
#include "py/mpthread.h"
3329
#include "shared/runtime/gchelper.h"
3430
#include "shared/runtime/softtimer.h"
3531
#include "gccollect.h"
36-
#include "systick.h"
3732

3833
void gc_collect(void) {
39-
// get current time, in case we want to time the GC
40-
#if 0
41-
uint32_t start = mp_hal_ticks_us();
42-
#endif
43-
4434
// start the GC
4535
gc_collect_start();
4636

@@ -57,15 +47,4 @@ void gc_collect(void) {
5747

5848
// end the GC
5949
gc_collect_end();
60-
61-
#if 0
62-
// print GC info
63-
uint32_t ticks = mp_hal_ticks_us() - start;
64-
gc_info_t info;
65-
gc_info(&info);
66-
printf("GC@%lu %lums\n", start, ticks);
67-
printf(" " UINT_FMT " total\n", info.total);
68-
printf(" " UINT_FMT " : " UINT_FMT "\n", info.used, info.free);
69-
printf(" 1=" UINT_FMT " 2=" UINT_FMT " m=" UINT_FMT "\n", info.num_1block, info.num_2block, info.max_block);
70-
#endif
7150
}

ports/stm32/led.c

-1
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,6 @@ void led_state(pyb_led_t led, int state) {
212212
}
213213

214214
const pin_obj_t *led_pin = pyb_led_obj[led - 1].led_pin;
215-
// printf("led_state(%d,%d)\n", led, state);
216215
if (state == 0) {
217216
// turn LED off
218217
MICROPY_HW_LED_OFF(led_pin);

ports/stm32/rtc.c

-5
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424
* THE SOFTWARE.
2525
*/
2626

27-
#include <stdio.h>
28-
2927
#include "py/runtime.h"
3028
#include "shared/timeutils/timeutils.h"
3129
#include "extint.h"
@@ -771,8 +769,6 @@ mp_obj_t pyb_rtc_wakeup(size_t n_args, const mp_obj_t *args) {
771769

772770
NVIC_SetPriority(RTC_WKUP_IRQn, IRQ_PRI_RTC_WKUP);
773771
HAL_NVIC_EnableIRQ(RTC_WKUP_IRQn);
774-
775-
// printf("wut=%d wucksel=%d\n", wut, wucksel);
776772
} else {
777773
// clear WUTIE to disable interrupts
778774
RTC->CR &= ~RTC_CR_WUTIE;
@@ -833,7 +829,6 @@ mp_obj_t pyb_rtc_calibration(size_t n_args, const mp_obj_t *args) {
833829
HAL_RTCEx_SetSmoothCalib(&RTCHandle, RTC_SMOOTHCALIB_PERIOD_32SEC, cal_p, cal_m);
834830
return mp_const_none;
835831
} else {
836-
// printf("CALR = 0x%x\n", (mp_uint_t) RTCHandle.Instance->CALR); // DEBUG
837832
// Test if CALP bit is set in CALR:
838833
if (RTCHandle.Instance->CALR & 0x8000) {
839834
cal = 512 - (RTCHandle.Instance->CALR & 0x1ff);

ports/stm32/storage.c

-5
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@
2424
* THE SOFTWARE.
2525
*/
2626

27-
#include <stdint.h>
28-
#include <string.h>
29-
3027
#include "py/runtime.h"
3128
#include "py/mperrno.h"
3229
#include "extmod/vfs_fat.h"
@@ -144,7 +141,6 @@ static void build_partition(uint8_t *buf, int boot, int type, uint32_t start_blo
144141
}
145142

146143
bool storage_read_block(uint8_t *dest, uint32_t block) {
147-
// printf("RD %u\n", block);
148144
if (block == 0) {
149145
// fake the MBR so we can decide on our own partition table
150146

@@ -176,7 +172,6 @@ bool storage_read_block(uint8_t *dest, uint32_t block) {
176172
}
177173

178174
bool storage_write_block(const uint8_t *src, uint32_t block) {
179-
// printf("WR %u\n", block);
180175
if (block == 0) {
181176
// can't write MBR, but pretend we did
182177
return true;

ports/stm32/usbdev/class/src/usbd_cdc_msc_hid.c

-17
Original file line numberDiff line numberDiff line change
@@ -821,23 +821,6 @@ static uint8_t USBD_CDC_MSC_HID_DeInit(USBD_HandleTypeDef *pdev, uint8_t cfgidx)
821821
}
822822

823823
static uint8_t USBD_CDC_MSC_HID_Setup(USBD_HandleTypeDef *pdev, USBD_SetupReqTypedef *req) {
824-
825-
/*
826-
printf("SU: %x %x %x %x\n", req->bmRequest, req->bRequest, req->wValue, req->wIndex);
827-
828-
This is what we get when MSC is IFACE=0 and CDC is IFACE=1,2:
829-
SU: 21 22 0 1 -- USB_REQ_TYPE_CLASS | USB_REQ_RECIPIENT_INTERFACE; CDC_SET_CONTROL_LINE_STATE
830-
SU: 21 20 0 1 -- USB_REQ_TYPE_CLASS | USB_REQ_RECIPIENT_INTERFACE; CDC_SET_LINE_CODING
831-
SU: a1 fe 0 0 -- 0x80 | USB_REQ_TYPE_CLASS | USB_REQ_RECIPIENT_INTERFACE; BOT_GET_MAX_LUN; 0; 0
832-
SU: 21 22 3 1 -- USB_REQ_TYPE_CLASS | USB_REQ_RECIPIENT_INTERFACE; CDC_SET_CONTROL_LINE_STATE
833-
834-
On a Mac OS X, with MSC then CDC:
835-
SU: a1 fe 0 0
836-
SU: 21 22 2 1
837-
SU: 21 22 3 1
838-
SU: 21 20 0 1
839-
*/
840-
841824
usbd_cdc_msc_hid_state_t *usbd = pdev->pClassData;
842825

843826
// Work out the recipient of the setup request

ports/stm32/usbdev/class/src/usbd_msc_scsi.c

-6
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,6 @@ int8_t SCSI_ProcessCmd(USBD_HandleTypeDef *pdev,
123123
uint8_t lun,
124124
uint8_t *params)
125125
{
126-
/*
127-
if (params[0] != SCSI_READ10 && params[0] != SCSI_WRITE10) {
128-
printf("SCSI_ProcessCmd(lun=%d, params=%x, %x)\n", lun, params[0], params[1]);
129-
}
130-
*/
131-
132126
switch (params[0])
133127
{
134128
case SCSI_TEST_UNIT_READY:

0 commit comments

Comments
 (0)