摘要 |
<p>A multitask execution method and device for a microcontroller of an electronic cigarette. The method comprises: determining tasks to be executed by the microcontroller and a permissible interval duration (S1) for executing each task twice; dividing the execution time of each task into a plurality of time slices sequentially, so as to enable a time slice to be respectively taken out at random from each task, and enable the sum obtained by adding the time slices taken out to be less than or equal to the minimum in the interval duration (S2); setting a status bit for each task, the status bit pointing to the time slice of the task (S3); and according to the time slice corresponding to the current status bit of each task, executing each task, and switching to the task next to the task when the time slice corresponding to the current status bit is ended (S4). The above-mentioned multitask execution method has the beneficial effects that the task execution efficiency of the microcontroller of the electronic cigarette is improved, the system of the electronic cigarette is made to be more stable, and the microcontroller of the electronic cigarette is low in performance requirement, is low in cost, and is easy to implement.</p> |