MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / rt_floppy_init

Function rt_floppy_init

bsp/x86/drivers/floppy.c:339–366  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

337}
338
339void rt_floppy_init(void)
340{
341 struct rt_device *device;
342
343 rt_mutex_init(&lock,"fdlock", RT_IPC_FLAG_PRIO);
344 rt_sem_init(&sem, "fdsem", 0, RT_IPC_FLAG_FIFO);
345
346 rt_hw_interrupt_install(FLOPPY_IRQ, rt_floppy_isr, RT_NULL, "floppy");
347 rt_hw_interrupt_umask(FLOPPY_IRQ);
348
349 floppy_get_info();
350 rt_kprintf("Floppy Inc : %s Floppy Type : %s\n",floppy_inc_name,floppy_type);
351
352 device = &(devF);
353
354 device->type = RT_Device_Class_Block;
355 device->init = rt_floppy_init_internal;
356 device->open = rt_floppy_open;
357 device->close = rt_floppy_close;
358 device->read = rt_floppy_read;
359 device->write = rt_floppy_write;
360 device->control = rt_floppy_control;
361 device->user_data = RT_NULL;
362
363 rt_device_register(device, "floppy",
364 RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_REMOVABLE | RT_DEVICE_FLAG_STANDALONE);
365
366}

Callers 1

flopyy_system_initFunction · 0.85

Calls 7

rt_mutex_initFunction · 0.85
rt_sem_initFunction · 0.85
floppy_get_infoFunction · 0.85
rt_kprintfFunction · 0.85
rt_device_registerFunction · 0.85
rt_hw_interrupt_installFunction · 0.50
rt_hw_interrupt_umaskFunction · 0.50

Tested by

no test coverage detected