MTP Close function

Drodru

Member
I am trying to build a portable device with Teensy. I gather data and I store it in SD and flash, and later I want to extract it. I want to extract it using MTP, without changing any program. My idea is to click a button, MTP starts, I gather the data, I click the button again, MTP port closes and it continues with what I was doing.
But I didn't find any way to close either the SD, the Flash or the whole MTP thing. Any help?
 
MTP can only be closed by the PC by unmounting the MTP device. Remember within MTP PC is the host/master and Teensy is the device/slave. ONLY the PC can give instructions that are to be executed by Teensy. In theory, PC could listen to requests from Teensy (by sending events) but the PC is not obliged to implement or honor these requests. Also, we have not found a method for the slave to figure out which requests the PC has implemented/honors.
 
So, there is no viable method. Can I set a timer to MTP.loop each 10 miliseconds and still work as expected?
 
My mode of operation is to call mtp.loop only when not acquiring data, that is when acquisition is stopped. Yes, there is no need to call mtp.loop continuously.
 
Nothing if your acquisition runs on interrupt level and mtp.loop is called from main loop. In order to see the file on the PC, MTP must be unmounted and remounted. For this operation, the PC expects some response from Teensy. If Teensy is busy with acquisition, MTP request will time out and die. So, best is to do either acquisition or mtp.
 
Back
Top