Skip to content

Commit ccb85e0

Browse files
PARKJIHOONandrewc-arm
authored andcommitted
tidy up unused printf
Signed-off-by: PARKJIHOON <[email protected]>
1 parent c8e7769 commit ccb85e0

File tree

9 files changed

+8
-89
lines changed

9 files changed

+8
-89
lines changed

targets/TARGET_Samsung/TARGET_SIDK_S5JS100/dcxo_update.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,10 @@
1717
*
1818
****************************************************************************/
1919

20-
#include "mbed.h"
2120
#include "modem_io_device.h"
2221
#include "s5js100_dcxo.h"
23-
2422
#include "mbed_trace.h"
23+
#include "mbed_error.h"
2524
#define TRACE_GROUP "DCXO"
2625

2726
#ifndef DCXO_UPDATE_DBG_ON

targets/TARGET_Samsung/TARGET_SIDK_S5JS100/device/sflash_api.cpp

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ int flash_idx = 0;
3535
#define CACHE_LINE_MASK 0xffffffe0
3636
#define CACHE_LINE_SIZE 32
3737
Semaphore *g_sem = new Semaphore(1);
38-
//int sflash_init=0;
3938

4039
/****************************************************************************
4140
* Public Function Prototypes
@@ -181,8 +180,6 @@ static void local_memcpy(void *dst, void *src, size_t n)
181180
unsigned char *pin = (unsigned char *)src;
182181
while (n-- > 0) {
183182
*pout++ = *pin++;
184-
//hw_delay_us(100 * S5JS100_FLASH_DELAYTIME);
185-
//printf(".");
186183
}
187184
}
188185

@@ -416,72 +413,55 @@ char *get_env(const char *name)
416413
/* hal/flash_api.h */
417414
int32_t flash_init(flash_t *obj)
418415
{
419-
printf("%s\n\r", __func__);
420416
SFlash_DriverInitialize();
421417
return 0;
422418
}
423419

424420
int32_t flash_free(flash_t *obj)
425421
{
426-
printf("%s\n\r", __func__);
427422
return 0;
428423
}
429424

430425
uint32_t flash_get_page_size(const flash_t *info)
431426
{
432-
// printf("%s, PAGE[1B]\n\r", __func__);
433-
return 4; /*S5JS100_FLASH_PAGE_SIZE*/ //byte program
427+
return 4; /*S5JS100_FLASH_PAGE_SIZE*/
434428
}
435429

436430
uint32_t flash_get_sector_size(const flash_t *info, uint32_t addr)
437431
{
438-
// printf("%s addr[0x%x], size[0x%x]\n\r", __func__, addr, S5JS100_FLASH_BLOCK_SIZE);
439-
return up_progmem_blocksize(); //4KB
432+
return up_progmem_blocksize();
440433
}
441434

442435
uint32_t flash_get_start_address(const flash_t *info)
443436
{
444-
// printf("%s addr[0x%x]\n\r", __func__, S5JS100_FLASH_FS_PADDR);
445437
return S5JS100_FLASH_FS_PADDR;
446438
}
447439

448440
uint32_t flash_get_size(const flash_t *info)
449441
{
450-
// printf("%s size[0x%x]\n\r", __func__, S5JS100_FLASH_FS_SIZE);
451442
return S5JS100_FLASH_FS_SIZE;
452443
}
453444

454445
int32_t flash_program_page(flash_t *obj, uint32_t addr, const uint8_t *data, uint32_t size)
455446
{
456-
// printf("\n\rW\r\n");
457447
if (addr > S5JS100_FLASH_PADDR) {
458-
printf("%s FLASH, addr[0x%x], size[%d]\n\r", __func__, addr, size);
459448
return sflash_write(addr, (unsigned char *)data, size);
460449
} else {
461-
// printf("%s, addr[0x%x], size[%d]\n\r", __func__, addr, size);
462-
// sflash_write(0x4086A000+flash_idx, (unsigned char *)data, size); //Write Test
463-
// printf("\n\rWRITE[0x%x], [0x%x]", addr, 0x4086A000+flash_idx);
464450
local_memcpy((void *)addr, (void *)data, size);
465451
return 0;
466452
}
467453
}
468454
uint8_t flash_get_erase_value(const flash_t *obj)
469455
{
470456
(void)obj;
471-
// printf("%s\n\r", __func__);
472457
return 0xFF;
473458
}
474459

475460
int32_t flash_erase_sector(flash_t *obj, uint32_t addr)
476461
{
477-
// printf("\n\rE\n\r");
478462
if (addr > S5JS100_FLASH_PADDR) {
479-
printf("%s FLASH addr[0x%x]\n\r", __func__, addr);
480463
return sflash_erase(addr);
481464
} else {
482-
// printf("%s addr[0x%x]\n\r", __func__, addr);
483-
// printf("\n\r[[ERASE]]\n\r"); //Erase Test
484-
// sflash_erase(0x4086A000);
485465
memset((void *)addr, 0xFFFFFFFF, 4096);
486466
return 0;
487467
}

targets/TARGET_Samsung/TARGET_SIDK_S5JS100/modem/modem_link_device_shmem.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ int ShmemIpcDevice::xmit_ipc_msg(mio_buf *msg)
175175

176176
if (chk_nospc) {
177177
/* TO DO - implement this back pressure to operate properly. */
178-
printf("ERROR Not implement %s:%d\n", __func__, __LINE__);
178+
mbed_error_printf("ERROR Not implement %s:%d\n", __func__, __LINE__);
179179
while (1);
180180
/* Set res_required flag for the "dev" */
181181
res_required = 1;
@@ -317,7 +317,7 @@ ShmemLinkDevice::ShmemLinkDevice()
317317

318318
ShmemLinkDevice::~ShmemLinkDevice()
319319
{
320-
printf("need to add code here ,%s\n\r", __func__);
320+
mbed_error_printf("need to add code here ,%s\n\r", __func__);
321321
}
322322

323323
/* To avoid race conditions start of RX/TX threads should be done
@@ -386,7 +386,7 @@ void rx_cmd_phone_start(void)
386386

387387
void rx_cmd_cp_crash(void)
388388
{
389-
printf("\n!!!!!CP Crash!!!!!\n");
389+
mbed_error_printf("\n!!!!!CP Crash!!!!!\n");
390390
if (!strcmp(get_env("CRASHDUMP"), "ON")) {
391391
mcpu_reset();
392392
mcpu_init(MCPU_CP);

targets/TARGET_Samsung/TARGET_SIDK_S5JS100/modem/shmem_save.cpp

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ void shmem_get_data(unsigned int *cs, unsigned int *nv, unsigned int *cal)
140140
g_flash_nv_base = FLASH_NV_BASE;
141141
g_flash_cal_base = FLASH_CAL_BASE;
142142
} else {
143-
printf("no support FLASH size..\n");
143+
mbed_error_printf("no support FLASH size..\n");
144144
}
145145

146146
section[0].start = g_flash_cs_base;
@@ -220,7 +220,6 @@ int shmem_data_save(unsigned int msg, uint8_t *buffer, uint16_t real_len, uint32
220220

221221
while (1) {
222222
wsize = (real_len - wlen + cached_size > psize) ? psize - cached_size : real_len - wlen;
223-
//printf("shmem_data_save:%d wsize : 0x%x cached_size : 0x%x real_len : 0x%x wlen : 0x%x psize : 0x%x buffer : 0x%x\n", __LINE__, wsize, cached_size, real_len, wlen, psize, buffer);
224223

225224
if (wsize != psize) {
226225
memcpy(save_cached + cached_size, buffer + wlen, wsize);
@@ -233,29 +232,24 @@ int shmem_data_save(unsigned int msg, uint8_t *buffer, uint16_t real_len, uint32
233232
poffset = (offset / psize) * psize;
234233
offset += wsize;
235234

236-
//printf("shmem_data_save:%d wsize : 0x%x cached_size : 0x%x real_len : 0x%x wlen : 0x%x psize : 0x%x buf : 0x%x\n", __LINE__, wsize, cached_size, real_len, wlen, psize, buf);
237-
238235
if (cached_size != psize) {
239236
break;
240237
}
241238

242-
//printf("shmem_data_save addr(0x%08X) size(%X) buf(%p)\n", flash_start_addr + poffset, psize, buf);
243239
cached_size = 0;
244240
sflash_erase(flash_start_addr + poffset);
245241
sflash_write(flash_start_addr + poffset, buf, psize);
246242
}
247243

248244
if (real_len + s_size >= t_size) {
249245
poffset = (offset / psize) * psize;
250-
//printf("shmem_data_save addr(0x%08X) size(%X) buf(%p)\n", flash_start_addr + poffset, cached_size, save_cached);
251246
if (cached_size + sizeof(shmem_section_data) <= psize) {
252247
memcpy(save_cached + 0xFF0, (unsigned char *)(&(next_shmem_section[section_idx])), 0x10);
253248
sflash_erase(flash_start_addr + poffset);
254249
sflash_write(flash_start_addr + poffset, save_cached, psize);
255250
} else {
256251
sflash_erase(flash_start_addr + poffset);
257252
sflash_write(flash_start_addr + poffset, save_cached, cached_size);
258-
//printf("shmem_data_save addr(0x%08X) size(%X) buf(%p)\n", flash_start_addr + poffset + psize, cached_size, save_cached);
259253
memcpy(save_cached + 0xFF0, (unsigned char *)(&(next_shmem_section[section_idx])), 0x10);
260254
sflash_erase(flash_start_addr + poffset + psize);
261255
sflash_write(flash_start_addr + poffset, save_cached, psize);
@@ -271,14 +265,12 @@ void shmem_factory_reset(void)
271265
unsigned int poffset = 0;
272266
/* erase NV */
273267
flash_start_addr = g_flash_nv_base;
274-
printf("erase NV [0x%x]\n", flash_start_addr);
275268
for (poffset = 0; poffset < 64; poffset++) {
276269
sflash_erase(flash_start_addr + poffset * 4096);
277270
}
278271

279272
/* erase CS */
280273
flash_start_addr = g_flash_cs_base;
281-
printf("erase CS [0x%x]\n", flash_start_addr);
282274
for (poffset = 0; poffset < 75; poffset++) {
283275
sflash_erase(flash_start_addr + poffset * 4096);
284276
}
@@ -310,12 +302,8 @@ void shmem_save_read_cb(mio_buf *buf, void *data)
310302
sent_size = *(uint32_t *)(buffer + 8);
311303
remain_len = *(uint32_t *)(buffer + 4) - *(uint32_t *)(buffer + 8);
312304

313-
//printf("%s:%d cur_save_target(0x%08X) len(%x)\n", __func__, __LINE__, cur_save_target, buf->len);
314-
//printf("msg_len : 0x%x t_size : 0x%x, s_size : 0x%x, real_len : 0x%x, remain_len : 0x%x\n", msg_len, total_size, sent_size, real_len, remain_len);
315-
316305
shmem_data_save(cur_save_target, buffer + 12, real_len, total_size, sent_size);
317306
} else {
318-
//printf("%s:%d cur_save_target(0x%08X) len(%x)\n", __func__, __LINE__, cur_save_target, buf->len);
319307
remain_len = 0;
320308
real_len = 0;
321309
}
@@ -329,8 +317,6 @@ void shmem_save_read_cb(mio_buf *buf, void *data)
329317
shmem_mio->register_ReadCb(shmem_initiate_cb, NULL);
330318
nbsleep_req = 1;
331319
nbsleep_sec = ((((unsigned long long)(getreg32(0x81000000 + 0xE4))) << 32) + getreg32(0x81000000 + 0xE8)) / 32768;
332-
printf("\nEnter NB sleep!! %lld seconds\n", nbsleep_sec);
333-
printf("\nOK\n");
334320
}
335321

336322
cur_save_target += 0x10;
@@ -340,7 +326,6 @@ void shmem_save_read_cb(mio_buf *buf, void *data)
340326
}
341327
}
342328

343-
//printf("%s:%d cur_save_target(0x%08X)\n", __func__, __LINE__, cur_save_target);
344329
shmem_mio->write((char *)(&cur_save_target), 4);
345330
}
346331

targets/TARGET_Samsung/TARGET_SIDK_S5JS100/rtc_api.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ time_t rtc_read(void)
5050
void rtc_write(time_t t)
5151
{
5252
g_base_timeval = t;
53-
// printf("base time will be %d\n", g_base_timeval);
5453
}
5554

5655
static uint8_t rtc_hex8_to_dec(uint8_t hex_val)

targets/TARGET_Samsung/TARGET_SIDK_S5JS100/s5js100_dcxo.cpp

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#include "mbed.h"
2121
#include "s5js100_dcxo.h"
2222
#include "s5js100_type.h"
23-
2423
#include "mbed_trace.h"
2524
#define TRACE_GROUP "DCXO"
2625

@@ -112,9 +111,6 @@ static unsigned int tsu_code_to_temperature(unsigned int tsu_code)
112111
ratio = ((int)(g_dcxo_tsu_table[index - 1] - tsu_code) * DCXO_TSU_TABLE_UNIT)
113112
/ (int)(g_dcxo_tsu_table[index - 1] - g_dcxo_tsu_table[index]);
114113
temp_code = base + ratio;
115-
//dbg("\ng_dcxo_tsu_table[index]:%d, g_dcxo_tsu_table[index-1]:%d\n", g_dcxo_tsu_table[index], g_dcxo_tsu_table[index-1]);
116-
//dbg("\nbase:%d, ratio:%d\n", base, ratio);
117-
118114
return temp_code;
119115
}
120116

@@ -150,11 +146,8 @@ static unsigned int tsu_temperature_to_code(unsigned int temp_celcius)
150146
****************************************************************************/
151147
int dcxo_tsu_isr(int irq, void *context, void *arg)
152148
{
153-
//dbg("%d, %d, %d\n", irq, context, arg);
154149
NVIC_DisableIRQ((IRQn_Type)irq);
155150

156-
//dbg("tsu_code : 0x%x, 0x%x, 0x%x, 0x%x\n", (getreg32(S5JS100_DCXO_CFG + DCXO_CFG_IRQ_STA1) & 0xFFFF0000) >> 16, getreg32(S5JS100_DCXO_CFG + DCXO_CFG_IRQ_STA1) & 0xFFFF, (getreg32(S5JS100_DCXO_CFG + DCXO_CFG_IRQ_STA0) & 0xFFFF0000) >> 16, getreg32(S5JS100_DCXO_CFG + DCXO_CFG_IRQ_STA0) & 0xFFFF);
157-
158151
tsu_interrupt_flag = 1;
159152

160153
if (irq == S5JS100_IRQ_TSU0) {
@@ -257,23 +250,12 @@ void s5js100_dcxo_ctb_loop(void)
257250
ctb_prev--;
258251
}
259252
s5js100_dcxo_set_tune_value(ctb_prev, 4096);
260-
//dcxollvdbg("[ctb_cal:%d, ctb_set:%d]\n", ctb, ctb_prev);
261253
}
262254

263255
if (ctb == 0) {
264256
S5JS100_DCXO_DBG("[ERROR]CTB was 0x0[temp:%d]!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n", tsu);
265-
//asm("b .");
266257
}
267258

268-
#if 0
269-
if ((tsu - 50000) > 0) {
270-
//printf("TSU : %d.%03d 'C, CTB : %d ( %d )\n", (tsu - 50000) / 1000, (tsu) % 1000, ctb, tsu);
271-
} else if ((tsu - 50000) > -1000) {
272-
//printf("TSU : -%d.%03d 'C, CTB : %d ( %d )\n", (tsu - 50000) / 1000, (1000 - (tsu) % 1000) % 1000, ctb, tsu);
273-
} else {
274-
//printf("TSU : %d.%03d 'C, CTB : %d ( %d )\n", (tsu - 50000) / 1000, (1000 - (tsu) % 1000) % 1000, ctb, tsu);
275-
}
276-
#endif
277259
loop_started = 1;
278260
dcxo_ctb_sem_release();
279261
osDelay(50);
@@ -434,17 +416,6 @@ int s5js100_dcxo_start_ctb_loop(Full_set_table_t tbl[])
434416
return 0;
435417
}
436418

437-
int s5js100_dcxo_stop_ctb_loop(void)
438-
{
439-
// if(!task_delete(g_dcxo_tid)){
440-
// lldbg("fail to delete ctb_loop task ..\n");
441-
// }
442-
// else
443-
// lldbg("ctb_loop stopped..\n");
444-
445-
return 0;
446-
}
447-
448419
/****************************************************************************
449420
* Name: s5js100_tsu_get_temperature
450421
*
@@ -591,8 +562,6 @@ int s5js100_dcxo_get_coarse_tune_value(void)
591562

592563
int s5js100_dcxo_set_tune_value(unsigned int coarse_value, unsigned int fine_value)
593564
{
594-
// printf("%s, coarse_value : 0x%x, fine_value : 0x%x\n", __func__, coarse_value, fine_value);
595-
596565
#if defined(DCXO_FINE_PMU_COARSE_DCXO)
597566
// Fine=DcxoFTune, Coarse=FTUNE2
598567
coarse_value <<= 6;
@@ -641,15 +610,11 @@ int s5js100_dcxo_set_tune_value(unsigned int coarse_value, unsigned int fine_val
641610
}
642611
#endif
643612

644-
//printf("dotsu : %d\n", s5js100_tsu_get_code());
645-
646613
return 1;
647614
}
648615

649616
int s5js100_dcxo_set_tune_value_20bit(unsigned int coarse_value, unsigned int fine_value)
650617
{
651-
//printf("%s, coarse_value : 0x%x, fine_value : 0x%x\n", __func__, coarse_value, fine_value);
652-
653618
#if defined(DCXO_FINE_PMU_COARSE_DCXO)
654619
// Coarse=DcxoFTune, Fine=FTUNE2
655620

@@ -671,7 +636,6 @@ int s5js100_dcxo_set_tune_value_20bit(unsigned int coarse_value, unsigned int fi
671636
// Fine=FTUNE2, Coarse=FTUNE
672637

673638
coarse_value >>= 6;
674-
//printf("coarse_value changed to 14 bit (0x%x)\n", coarse_value);
675639

676640
// Fine = FTUNE2 13bit
677641
// EVT0 : 0x81000528[31:17], EVT1 : 0x8100000C[28:14]
@@ -693,7 +657,6 @@ int s5js100_dcxo_set_tune_value_20bit(unsigned int coarse_value, unsigned int fi
693657
// Fine=DcxoFTune, Coarse=FTUNE2
694658

695659
coarse_value >>= 6;
696-
//printf("coarse_value changed to 14 bit (0x%x)\n", coarse_value);
697660

698661
// Fine = DcxoFTune 20bit
699662
modifyreg32(S5JS100_DCXO_CFG + DCXO_CFG_DSM_CFG0, 0xFFFFF << 1, fine_value << 1);
@@ -738,7 +701,6 @@ int s5js100_dcxo_set_dsmdither(unsigned int dither_bit_sel)
738701
modifyreg32(S5JS100_DCXO_CFG + DCXO_CFG_SW_RESETN, (1 << 3), 0);
739702
modifyreg32(S5JS100_DCXO_CFG + DCXO_CFG_SW_RESETN, (1 << 3), (1 << 3));
740703
#else
741-
//printf("To enable dsm dither, DCXO option should be changed to DCXO_FINE_PMU_COARSE_DCXO\n"
742704
#endif
743705
return 1;
744706
}
@@ -751,7 +713,6 @@ int s5js100_dcxo_set_dither_bit_sel(unsigned int dither_bit_sel)
751713
modifyreg32(S5JS100_DCXO_CFG + DCXO_CFG_SW_RESETN, (1 << 3), 0);
752714
modifyreg32(S5JS100_DCXO_CFG + DCXO_CFG_SW_RESETN, (1 << 3), (1 << 3));
753715
#else
754-
//printf("DCXO option should be changed to DCXO_FINE_PMU_COARSE_DCXO\n"
755716
#endif
756717
return 1;
757718
}
@@ -764,7 +725,6 @@ int s5js100_dcxo_set_dsm_type(unsigned int dsm_type)
764725
modifyreg32(S5JS100_DCXO_CFG + DCXO_CFG_SW_RESETN, (1 << 3), 0);
765726
modifyreg32(S5JS100_DCXO_CFG + DCXO_CFG_SW_RESETN, (1 << 3), (1 << 3));
766727
#else
767-
//printf("DCXO option should be changed to DCXO_FINE_PMU_COARSE_DCXO\n"
768728
#endif
769729
return 1;
770730
}
@@ -777,7 +737,6 @@ int s5js100_dcxo_set_en_dsm_dither(unsigned int en_dsm_dither)
777737
modifyreg32(S5JS100_DCXO_CFG + DCXO_CFG_SW_RESETN, (1 << 3), 0);
778738
modifyreg32(S5JS100_DCXO_CFG + DCXO_CFG_SW_RESETN, (1 << 3), (1 << 3));
779739
#else
780-
//printf("DCXO option should be changed to DCXO_FINE_PMU_COARSE_DCXO\n"
781740
#endif
782741
return 1;
783742
}
@@ -790,7 +749,6 @@ int s5js100_dcxo_set_prbs_sel(unsigned int prbs_sel)
790749
modifyreg32(S5JS100_DCXO_CFG + DCXO_CFG_SW_RESETN, (1 << 3), 0);
791750
modifyreg32(S5JS100_DCXO_CFG + DCXO_CFG_SW_RESETN, (1 << 3), (1 << 3));
792751
#else
793-
//printf("DCXO option should be changed to DCXO_FINE_PMU_COARSE_DCXO\n"
794752
#endif
795753
return 1;
796754
}
@@ -803,7 +761,6 @@ int s5js100_dcxo_en_dsm(unsigned int en_dsm)
803761
modifyreg32(S5JS100_DCXO_CFG + DCXO_CFG_SW_RESETN, (1 << 3), 0);
804762
modifyreg32(S5JS100_DCXO_CFG + DCXO_CFG_SW_RESETN, (1 << 3), (1 << 3));
805763
#else
806-
//printf("DCXO option should be changed to DCXO_FINE_PMU_COARSE_DCXO\n"
807764
#endif
808765
return 1;
809766
}

0 commit comments

Comments
 (0)