USB u;
USBSerial usbserial(&u);
-USBMSD msc(&u, &sd);
+USBMSD *msc;
DFU dfu(&u);
SDFAT mounter("sd", &sd);
leds[i] = (i & 1) ^ 1;
}
- sd.disk_initialize();
+ bool sdok= (sd.disk_initialize() == 0);
Kernel* kernel = new Kernel();
// Create and initialize USB stuff
u.init();
- kernel->add_module( &msc );
+ if(sdok) { // only do this if there is an sd disk
+ msc= new USBMSD(&u, &sd);
+ kernel->add_module( msc );
+ }
+
kernel->add_module( &usbserial );
if( kernel->config->value( second_usb_serial_enable_checksum )->by_default(false)->as_bool() ){
kernel->add_module( new USBSerial(&u) );