Fixme

Discover which code snippets in open source project is need to be fixed.

Search Snippets

Upload Tips

We have provided a tool to collect code snippets with FIXME comments and upload them here.

See more

Languages

RT-Thread
so easy (0 ratings)  •  Last indexed on

spin_unlock_irqrestore(&host->lock, flags);

458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
ret = rt_completion_wait(&mmc_drv->transfer_completion, RT_TICK_PER_SECOND * 5);

    reg = MMC_GetInterruptMask(mmc_obj);
    reg &= ~MMC_INT_STATUS_DATA;
    MMC_SetInterruptMask(mmc_obj, reg);

    if(ret)
    {
        //fixme: error handle
        cmd->err = ret;
        interrupt = MMC_GetRawInterrupt(mmc_obj);
        status = MMC_GetStatus(mmc_obj);
        rt_kprintf("ERROR: %s, transfer timeout, ret: %d, RINTSTS: 0x%x, STATUS: 0x%x\n", __func__, ret, interrupt, status);
        //PRINT_MMC_REGS(mmc_obj->base);
        return -RT_ETIMEOUT;
    }
RT-Thread
so easy (0 ratings)  •  Last indexed on
spin_lock_irqsave(&host->lock, flags);

open data interrupts

453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
reg = MMC_GetInterruptMask(mmc_obj);
    reg |= MMC_INT_STATUS_DATA;
    MMC_SetInterruptMask(mmc_obj, reg);

    //fixme: spin_unlock_irqrestore(&host->lock, flags);
    ret = rt_completion_wait(&mmc_drv->transfer_completion, RT_TICK_PER_SECOND * 5);

    reg = MMC_GetInterruptMask(mmc_obj);
    reg &= ~MMC_INT_STATUS_DATA;
    MMC_SetInterruptMask(mmc_obj, reg);

    if(ret)
    {
        //fixme: error handle
        cmd->err = ret;
        interrupt = MMC_GetRawInterrupt(mmc_obj);
RT-Thread
so easy (0 ratings)  •  Last indexed on

spin_lock_irqsave?

383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
do
    {
        status = MMC_GetRawInterrupt(mmc_obj);
        tick = rt_tick_get();
        if(tick > timeout)
        {
            PRINT_MMC_DBG("ERROR: %s, get response timeout(cmd is not received by card), RINTSTS: 0x%x, cmd: %d\n", __func__, status, cmd->cmd_code);
            return -RT_ETIMEOUT;
        }
    }
    while(!(status & MMC_INT_STATUS_CMD_DONE));

    MMC_ClearRawInterrupt(mmc_obj, MMC_INT_STATUS_CMD_DONE);

    for (i = 0; i < 4; i++)
    {
RT-Thread
so easy (0 ratings)  •  Last indexed on

stop dma

217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
rt_kprintf("ERROR: %s, cmd is NULL\n", __func__);
        return;
    }

    if (data)
    {
        cmd_flags |= MMC_CMD_FLAG_DATA_EXPECTED;
        /* always set data start - also set direction flag for read */
        if (data->flags & DATA_DIR_WRITE)
            cmd_flags |= MMC_CMD_FLAG_WRITE_TO_CARD;

        if (data->flags & DATA_STREAM)
            cmd_flags |= MMC_CMD_FLAG_DATA_STREAM;
    }

    if (cmd == req->stop)
RT-Thread
so easy (0 ratings)  •  Last indexed on

cmd->data or req->data

206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
struct rt_mmcsd_data *data = cmd->data;
    int ret;

    rt_uint32_t retries = 0;
    rt_uint32_t cmd_flags = 0;

    PRINT_MMC_DBG("%s, start\n", __func__);

    if (!cmd)
    {
        //fixme: stop dma
        rt_kprintf("ERROR: %s, cmd is NULL\n", __func__);
        return;
    }

    if (data)
RT-Thread
so easy (0 ratings)  •  Last indexed on
read from PMU

why io_cfg->clock == 0 ?

134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
if(io_cfg->clock)
    {
        clkdiv = MMC_CLOCK_IN / io_cfg->clock / 2;
        MMC_UpdateClockRegister(mmc_obj, clkdiv);
        PRINT_MMC_DBG("io_cfg->clock: %lu, clock in: %lu, clkdiv: %d\n", io_cfg->clock, MMC_CLOCK_IN, clkdiv);
    }

    if (io_cfg->bus_width == MMCSD_BUS_WIDTH_4)
    {
        MMC_SetCardWidth(mmc_obj, MMC_CARD_WIDTH_4BIT);
        PRINT_MMC_DBG("set to 4-bit mode\n", MMC_CLOCK_IN, clkdiv);
    }
    else
    {
        MMC_SetCardWidth(mmc_obj, MMC_CARD_WIDTH_1BIT);
        PRINT_MMC_DBG("set to 1-bit mode\n", MMC_CLOCK_IN, clkdiv);
RT-Thread
so easy (0 ratings)  •  Last indexed on

never release?

453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
}

static rt_err_t fh_i2c_read_reg(struct rt_i2c_bus_device *fh81_i2c,
		rt_uint16_t reg, rt_uint8_t *data) {
	struct rt_i2c_msg msg[2];
	rt_uint8_t send_buf[2];
	rt_uint8_t recv_buf[1] = {0};

	PRINT_I2C_DBG("%s start\n", __func__);

	//  send_buf[0] = ((reg >> 8) & 0xff);
	send_buf[0] = (reg & 0xFF);

	msg[0].addr = 0x51;
	msg[0].flags = RT_I2C_WR;
	msg[0].len = 1;
RT-Thread
so easy (0 ratings)  •  Last indexed on

get from clk tree

425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
i2c_obj->input_clock = 15000;

    I2C_Init(i2c_obj);

    PRINT_I2C_DBG("%s end\n", __func__);
    return ret;

}

int fh_i2c_exit(void *priv_data)
{
    return 0;
}

struct fh_board_ops i2c_driver_ops =
{

shutter width: 1 ~ (Frame format(V) - 3)

1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
if(shutter_width < 1)
    {
        shutter_width = 1;
    }
    else if(shutter_width  > (frame_length_lines - 3))
    {
        shutter_width = frame_length_lines - 3;
    }
    // shutter_width = 1,
#ifdef SENSOR_DEBUG
    GM_Printf("V:%d, shutter_width: %d\n", frame_length_lines, shutter_width);
#endif
    shutter_width <<= 4; //the register value should be exposure time * 16

    errCode |= ov2710_write_reg(pHandle, OV2710_AEC_PK_EXPO_H, (U8)((shutter_width & 0x0F0000) >> 16) );
    errCode |= ov2710_write_reg(pHandle, OV2710_AEC_PK_EXPO_M, (U8)((shutter_width & 0x00FF00) >> 8 ) );
RT-Thread
so easy (0 ratings)  •  Last indexed on

shutter width: 1 ~ (Frame format(V) - 2)

1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
if(shutter_width < 1)
    {
        shutter_width = 1;
    }
    else if(shutter_width  > frame_length_lines - 2)
    {
        shutter_width = frame_length_lines - 2;
    }

#ifdef SENSOR_DEBUG
    GM_Printf("shutter_width: 0x%x\n", shutter_width);
#endif
    errCode |= ov9710_write_reg(pHandle, OV9710_AECH, (U8)((shutter_width & 0x00FF00) >> 8 ) );
    errCode |= ov9710_write_reg(pHandle, OV9710_AEC, (U8)((shutter_width & 0x0000FF) >> 0 ) );

    pinfo->current_shutter_time = shutter_time;