1. Technical Field
Embodiments of the present disclosure relate generally to flash memory drives, and more particularly to a Universal Serial Bus (USB) flash drive and a method for determining available storage capacity of the USB flash drive.
2. Description of Related Art
USB flash drives are very useful and convenient. When a user has multiple USB flash drives and wants to store data onto a USB drive, he/she must plug in one USB flash drive one at a time and check available memory of each of the USB drives to find one that can hold the data. This method is inconvenient and causes wear and tear on the both drive and the computer USB connection.
Accordingly, there is a need for an improved method for a method for determining available storage capacity of the USB flash drive, to overcome the above-mentioned problems.
The disclosure is illustrated by way of example and not by way of limitation in the figures of the accompanying drawings in which like references indicate similar elements. It should be noted that references to “an” or “one” embodiment in this disclosure are not necessarily to the same embodiment, and such references mean at least one.
The USB interface 11 can be plugged into a computing device, such as a personal computer (PC), or a digital camera, for example. The interface 11 is operable to transfer data between the USB flash drive 1 and the computer device when the USB interface 11 is connected to the computing device.
The storage unit 13 stores a file system for recording storage capacity information of the USB flash drive 1. In one embodiment, the file system may be a type of FAT16, FAT32, NTFS, EXT2 or EXT3 file system. The storage capacity information includes a current storage capacity, which is equal to the storage capacity of the USB flash drive 1 less the amount of memory currently in use. The storage capacity information also includes a previous storage capacity at the last use of the USB flash drive 1. The storage unit 13 may be a random access memory (RAM) for temporary storage of information, and/or a read only memory (ROM) for permanent storage of information.
The control unit 12 is operable to identify a type of the file system stored in the storage unit 13, and obtain the current storage capacity and the previous storage capacity of the USB flash drive 1 from the storage unit 13 according to the file system type. The control unit 12 calculates a storage capacity difference (denoted as “Ds”) between the current storage capacity and the previous storage capacity of the USB flash drive 1, and determines whether the storage capacity difference is equal to zero.
The control unit 12 is further operable to generate an enabling signal for turning on the logical circuit 15 if the storage capacity difference is not equal to zero. The control unit 12 calculates a runtime (denoted as “Tr”) of the dial pointer 161 according to a time calculation algorithm when the dial pointer 161 points to a mark of the scale dial 160 corresponding to the current storage capacity of the USB flash drive 1. In one embodiment, if the total storage capacity of the USB flash drive 1 is 1 GB, the time calculation algorithm is described as follows. Assuming that a reference storage capacity (denoted as “Rs”) is represented as Rs=1 GB/360 degrees, the dial pointer 161 runs a reference mark (e.g., 5 marks) around the scale dial 160 when the electromagnetic rotor 164 rotates 180 degrees per second under the pulsed magnetic field. The control unit 12 calculates a rotation degree (denoted as “Dr”) of the dial pointer 161, and determines whether the storage capacity difference is a positive value or a negative value. If the storage capacity difference is a positive value, the control unit 12 calculates the rotation degree as a absolute value of the storage capacity difference divided by the reference storage capacity, i.e., Dr=|Ds/Rs| degrees. If the storage capacity difference is a negative value, the control unit 12 calculates the rotation degree as 360 degrees subtracted from the absolute value, i.e., Dr=360−|Ds/Rs| degrees. The control unit 12 calculates the runtime of the dial pointer 161 as the rotation degree divided by the reference mark, i.e., Tr=Dr/5 seconds.
The control unit 12 is operable to control the timer 14 to count incrementing a time value (denoted as “Tv”) by one, i.e., Tv=Tv+1, when the dial pointer 161 runs one mark along the scale dial 160. The control unit 12 is operable to determine whether the runtime Tr is equal to the time value Tr, and generate an interrupt signal for shutting off the logical circuit 15 when the runtime Tr is equal to the time value Tr.
The logical circuit 15 is operable to output a high voltage (e.g., 5 Volts) to the quartz meter 16 to control the dial pointer 161 to run around the scale dial 160 when the enabling signal is received from the control unit 12. The logical circuit 15 is operable to output a low voltage (e.g., 0 Volts) to the quartz meter 16 to control the dial pointer 161 to stop running around the scale dial 160 when the interrupt signal is received from the control unit 12.
The quartz meter 16 is operable to control the dial pointer 161 to point to a mark of the scale dial 160 corresponding to the current storage capacity of the USB flash drive 1 when the quartz meter 16 receives the high voltage. Referring to
In block S41, a user plugs the USB flash drive 1 into a computing device via the USB interface 11. In one embodiment, the computing device may be a personal computer (PC), or a digital camera, for example. In block S42, the control unit 12 identifies a file system type of the USB flash drive according to storage capacity information stored in the storage unit 13. As mentioned above, the file system type may be a type of FAT16, FAT32, NTFS, EXT2 or EXT3 file system. The storage capacity information may include a current storage capacity and a previous storage capacity of the USB flash drive 1. In block S43, the control unit 12 obtains the current storage capacity and the previous storage capacity of the USB flash drive 1 from the storage unit 13 according to the file system type.
In block S44, the control unit 12 calculates a storage capacity difference between the current storage capacity equals the previous storage capacity, and determines whether the storage capacity difference is equal to zero. If the storage capacity difference is equal to zero, block S45 implements. If the storage capacity difference is not equal to zero, the flow ends.
In block S45, the control unit 12 calculates a runtime (denoted as “Tr”) of the quartz meter 16 according to a time calculation algorithm. As described in
In block S46, the control unit 12 generates an enabling signal, and turns on the logical circuit 15 to output a high voltage (e.g., 5 Volts) to the quartz meter 1 according to the enabling signal. In block S47, the control unit 12 controls the timer 14 to count incrementing a time value (denoted as “Tv”) by one, i.e., Tv=Tv+1. In block S48, the control unit 12 controls the dial pointer 161 to run around the scale dial 160 when the quartz meter 16 receives the high voltage from the logical circuit 15. In block S49, the control unit 12 determines whether the runtime Tr is equal to the time value Tv. If the runtime Tr is equal to the time value Tv, block S50 implements. If the runtime Tr is not equal to the time value Tv, the flows returns to block S47.
In block S50, the control unit 12 generates an interrupt signal, and shuts off the logical circuit 15 to output a low voltage (e.g., 0 Volt) to the quartz meter 16 to control the dial pointer 161 to stop running around the scale dial 160 according to the interrupt signal. In block S51, the control unit 12 records the current capacity information of the USB flash drive 1 into the storage unit 13.
In block S52, the dial pointer 161 to point to a mark of the scale dial 160 corresponding to the current storage capacity of the USB flash drive 1 when the quartz meter 16 receives the high voltage. Referring to
Although certain inventive embodiments of the present disclosure have been specifically described, the present disclosure is not to be construed as being limited thereto. Various changes or modifications may be made to the present disclosure without departing from the scope and spirit of the present disclosure.
Number | Date | Country | Kind |
---|---|---|---|
2009 1 0311996 | Dec 2009 | CN | national |
Number | Name | Date | Kind |
---|---|---|---|
6816071 | Conti | Nov 2004 | B2 |
7120813 | Leydier et al. | Oct 2006 | B2 |
7221306 | Young | May 2007 | B2 |
7683801 | Winarski | Mar 2010 | B2 |
7762470 | Finn et al. | Jul 2010 | B2 |
Number | Date | Country |
---|---|---|
2004326146 | Nov 2004 | JP |
Number | Date | Country | |
---|---|---|---|
20110148655 A1 | Jun 2011 | US |