Photographing machine control system, method and device based on RT-thread driving framework and storage medium

CN119974793BActive Publication Date: 2026-08-11GUANGZHOU SENYANG ELECTRONIC TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-14
Publication Date
2026-08-11

AI Technical Summary

Technical Problem

[0003]然而,随着市场的不断发展和用户需求的日益多样化,这种传统的开发模式逐渐暴露出诸多问题,尽管主流写真机产品已经具备了相对完善的主体功能代码,但在实际应用场景中,仍面临着诸多挑战,一方面,介质种类的持续增加和色彩选择的极大丰富,使得市场对于写真机的衍生需求呈现出爆炸式增长,例如在广告制作领域,不同的宣传场景可能需要使用不同的打印介质,从户外广告牌的防水防晒材质到室内海报的特殊纹理纸张,对墨盒的兼容性和适应性也提出了更高要求,同时像在高温高湿的车间环境或低温干燥的展示场地等特定环境下进行打印时,需要写真机能够自动调整打印参数以确保打印质量的稳定性,此外,用户对于打印过程中的信息反馈精度也有了更高的期望,他们希望能够实时、准确地了解喷头状态、墨水余量、打印进度等详细信息,面对这些复杂多变的需求,产品开发团队往往只能采取在现有主体代码基础上不断堆叠和添加新功能的方式来应对,但这种做法导致每次固件更新都演变成一个极为漫长且复杂的过程,涉及大量的代码调试、兼容性测试等工作,不仅耗费了大量的人力、物力和时间成本,还容易引入新的问题和隐患,严重影响了写真机产品的更新换代速度和市场竞争力

Benefits of technology

[0039]与现有技术相比,本发明的有益效果是:本发明系统通过模块化设计将写真机的功能划分为独立的模块,如打印头控制、色彩管理和介质进给等,根据用户需求快速定制和扩展功能,提高了固件的灵活性和可维护性,与传统固件相比模块化设计使得特定功能模块可以独立更新和替换,避免了对整个系统的影响从而加快了功能迭代的速度,系统采用RTOS的多任务和实时处理能力,实现了任务调度、资源管理和通信机制的高效协调,确保系统在高负载下的稳定运行,提升了整体性能和可靠性,解决了现有固件在复杂打印任务中可能出现的稳定性问题,此外本发明通过配置模块,提供用户友好的界面,使用户能够根据需求选择和定制功能模块,打破传统固件的封闭性,允许用户进行个性化配置,提升了用户体验,在固件更新方面,本发明支持动态配置和快速部署,通过自动组装模块化代码片段和重构项目代码,显著缩短了固件从开发到部署的时间,满足了市场对快速响应和即时修复的需求,解决了现有固件更新周期缓慢的问题,在调试和测试方面,系统提供了功能测试与调试模块,为用户提供调试工具和测试用例,简化了调试流程,使得开发人员能够更高效地进行功能验证,减少了定位问题的时间,提高了测试效率,最后系统通过RTOS的安全特性和优化的打印流程,降低了数据泄露和能源浪费的风险。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119974793B_ABST
    Figure CN119974793B_ABST
Patent Text Reader

Abstract

This invention discloses a photo printer control system, method, device, and storage medium based on the RT-Thread driver framework. Through the multi-tasking and real-time processing capabilities of an RTOS, the integrated module effectively coordinates the operation of each module, ensuring efficient management of tasks, resources, and communication. The functional division module refines the photo printer's functions into independent parts such as printhead control and develops dedicated firmware to achieve standardization. The configuration module, through a user interface combined with the RT-Thread system's env menu function, provides a customizable configuration interface. The project refactoring and compilation module dynamically operates the code according to user selection, completing assembly, refactoring, and compilation. The firmware download and deployment module realizes a complete deployment process from transmission to burning. The functional testing and debugging module ensures normal functionality and assists in verification. This system improves the flexibility and efficiency of photo printer firmware development, can meet diverse user needs, and demonstrates considerable application potential and development prospects in the photo printer industry.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of firmware development and testing technology for photo printers, and more specifically, to a photo printer control system, method, device, and storage medium based on the RT-Thread driver framework. Background Technology

[0002] In the current photo printer market, existing firmware development solutions typically focus on implementing several basic and key functional modules. Among these, high-precision printing ensures clear and detailed image output, accurately reproducing every detail of the design draft; a professional color management system enables precise color matching and presentation, achieving satisfactory color effects for both vibrant advertising images and realistic artworks; and support for special printing media further expands the application range of photo printers, allowing them to print on various materials such as vinyl, silk, and canvas.

[0003] However, with the continuous development of the market and the increasing diversification of user needs, this traditional development model has gradually exposed many problems. Although mainstream photo printers have relatively complete core function codes, they still face many challenges in actual application scenarios. On the one hand, the continuous increase in media types and the greatly enriched color selection have led to an explosive growth in the market's derivative demand for photo printers. For example, in the field of advertising production, different promotional scenarios may require the use of different printing media, from waterproof and sun-resistant materials for outdoor billboards to special textured paper for indoor posters, which also places higher demands on the compatibility and adaptability of ink cartridges. At the same time, printing in specific environments such as high-temperature and high-humidity workshops or low-temperature and dry exhibition venues also presents challenges. In addition, users have higher expectations for the accuracy of information feedback during the printing process. They want to know detailed information such as printhead status, ink level, and printing progress in real time and accurately. Faced with these complex and ever-changing needs, product development teams often have no choice but to keep adding new features to the existing main code. However, this approach makes each firmware update an extremely long and complicated process, involving a lot of code debugging, compatibility testing, and other work. This not only consumes a lot of manpower, material resources, and time, but also easily introduces new problems and hidden dangers, which seriously affects the speed of product updates and market competitiveness of inkjet printers.

[0004] Therefore, existing technologies suffer from problems such as limited functionality, closed systems, hardware dependence, slow updates, difficulties in debugging and testing, lack of modularity, and inability to meet diverse needs. Summary of the Invention

[0005] In order to overcome the above-mentioned technical problems in the existing technology, the present invention designs a photo printer control system, method, device and storage medium based on the RT-Thread driving framework, which can effectively solve the above-mentioned technical problems.

[0006] To solve the above-mentioned technical problems, the technical solution of the present invention is as follows:

[0007] The image printer control system based on the RT-Thread driver framework includes:

[0008] The integration module is used to leverage the multitasking and real-time processing capabilities of the RTOS, coordinate the operation of various modules, and implement task scheduling, resource management, and communication mechanisms.

[0009] The functional division module is used to divide the functions of the photo printer into independent modules and develop specific firmware for each module. The firmware implements the encapsulation of functions and the standardization of interfaces.

[0010] The configuration module provides menu options through the user interface, allowing users to select the desired functional modules. It also utilizes the RT-Thread system's env menu function to implement the configuration interface, enabling users to select and customize functional modules according to their needs.

[0011] The project refactoring and compilation module is used to dynamically configure firmware code and compile it to generate and run the firmware according to the user's selection. This includes automatically assembling modular code snippets, as well as automatically refactoring project code and compiling and running the firmware.

[0012] The firmware download and deployment module is used to download the generated firmware code into the memory of the photo printer and deploy it, including implementing the firmware transmission, verification and burning programs;

[0013] The functional testing and debugging module is used to perform functional testing on the deployed photo printer, ensuring that the selected modules work properly, and providing debugging tools and test cases to assist users in functional verification.

[0014] Preferably, the functional division module includes:

[0015] Functional division unit is used to divide the functions of the photo printer into independent modules, including printhead control, color management and media feeding;

[0016] The firmware development unit is used to develop specific firmware for each module, thereby encapsulating functions and standardizing interfaces.

[0017] The module selection unit is used to select the appropriate functional modules to be added to the system construction according to user needs.

[0018] Preferably, the configuration module includes:

[0019] User interface unit, used to provide menu options for users to select the required functional modules;

[0020] The configuration interface unit is used to implement the configuration interface using the env menu function of the RT-Thread system, allowing users to select and customize functional modules according to their needs.

[0021] Preferably, the project refactoring compilation module includes:

[0022] The code dynamic configuration unit is used to dynamically configure firmware code based on user selections;

[0023] The compilation and generation unit is used to compile and generate the firmware for running, including automatically assembling modular code snippets, automatically refactoring project code, and compiling and running the firmware.

[0024] Preferably, the firmware download and deployment module includes:

[0025] Firmware transmission unit, used to download the generated firmware code into the memory of the photo printer;

[0026] The verification and burning unit is used to verify the firmware and burn the program.

[0027] Preferably, the functional testing and debugging module includes:

[0028] The functional testing unit is used to test the functionality of the deployed photo printer to ensure that the selected modules work properly.

[0029] The debugging tool provider unit provides debugging tools and test cases to assist users in functional verification.

[0030] The control method for a photo printer based on the RT-Thread driver framework includes the following steps:

[0031] S1: Utilize the multitasking and real-time processing capabilities of the RTOS to coordinate the operation of various modules and realize task scheduling, resource management, and communication mechanisms.

[0032] S2: Divide the functions of the photo printer into independent modules, including printhead control, color management and media feeding, and develop specific firmware for each module to achieve functional encapsulation and interface standardization;

[0033] S3: Provides menu options through the user interface, allowing users to select the required functional modules, and utilizes the RT-Thread system's env menu function to implement a configuration interface, allowing users to select and customize functional modules according to their needs;

[0034] S4: User selection, dynamic configuration of firmware code and compilation to generate and run the firmware, including automatic assembly of modular code snippets, as well as automatic refactoring of project code and compilation and running of firmware;

[0035] S5: Download the generated firmware code into the memory of the photo printer and deploy it, including implementing the firmware transmission, verification and burning program;

[0036] S6: Perform functional testing on the deployed photo printer to ensure that the selected modules work properly, and provide debugging tools and test cases to assist users in verifying the functionality.

[0037] A computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the photo printer control method based on the RT-Thread driver framework described above.

[0038] An electronic device includes a processor and a memory, the memory storing a computer program executable on the processor, the computer program being executed by the processor to implement the steps of the photo printer control method based on the RT-Thread driver framework described above.

[0039] Compared with existing technologies, the beneficial effects of this invention are as follows: This invention's system divides the functions of the photo printer into independent modules through modular design, such as printhead control, color management, and media feeding. Functions can be quickly customized and expanded according to user needs, improving firmware flexibility and maintainability. Compared with traditional firmware, the modular design allows specific functional modules to be updated and replaced independently, avoiding impact on the entire system and thus accelerating the speed of functional iteration. The system adopts the multi-tasking and real-time processing capabilities of an RTOS, achieving efficient coordination of task scheduling, resource management, and communication mechanisms, ensuring stable operation under high load, improving overall performance and reliability, and solving the stability problems that may occur in existing firmware during complex printing tasks. Furthermore, this invention provides a user-friendly interface through a configuration module. Users can select and customize functional modules according to their needs, breaking the closed nature of traditional firmware and allowing users to personalize configurations, thus improving the user experience. In terms of firmware updates, this invention supports dynamic configuration and rapid deployment. By automatically assembling modular code snippets and refactoring project code, it significantly shortens the time from firmware development to deployment, meeting the market's demand for rapid response and immediate fixes, and solving the problem of slow update cycles in existing firmware. In terms of debugging and testing, the system provides functional testing and debugging modules, offering users debugging tools and test cases, simplifying the debugging process, enabling developers to perform functional verification more efficiently, reducing the time for locating problems, and improving testing efficiency. Finally, the system reduces the risk of data leakage and energy waste through the security features of RTOS and optimized printing processes. Attached Figure Description

[0040] To more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are merely exemplary. For those skilled in the art, other embodiments can be derived from the provided drawings without creative effort.

[0041] Figure 1 This is a structural diagram of the control system for a photo printer based on the RT-Thread driver framework.

[0042] Figure 2 A step diagram illustrating the control method for a photo printer based on the RT-Thread driver framework;

[0043] Figure 3 This is a network structure diagram of a photo printer;

[0044] Figure 4 This is a modular program flowchart of the present invention;

[0045] Figure 5This is a flowchart of the firmware generation and testing procedure of the present invention;

[0046] Figure 6 This is a flowchart of the functional testing procedure for the present invention;

[0047] Figure 7 This is a diagram of the menu selection page of the present invention;

[0048] Figure 8 The firmware code generation result diagram for this invention;

[0049] Figure 9 This is the MSH information interaction diagram of the present invention. Detailed Implementation

[0050] The accompanying drawings are for illustrative purposes only and should not be construed as limiting the scope of this patent.

[0051] To better illustrate this embodiment, some parts in the accompanying drawings may be omitted, enlarged, or reduced, and do not represent the actual product dimensions;

[0052] It will be understood by those skilled in the art that certain well-known structures and their descriptions may be omitted in the accompanying drawings.

[0053] The technical solution of the present invention will be further described below with reference to the accompanying drawings and embodiments.

[0054] Example 1

[0055] A photo printer control system based on the RT-Thread driver framework, such as Figure 1 As shown, it includes:

[0056] The integration module is used to leverage the multitasking and real-time processing capabilities of the RTOS, coordinate the operation of various modules, and implement task scheduling, resource management, and communication mechanisms.

[0057] The functional division module is used to divide the functions of the photo printer into independent modules and develop specific firmware for each module. The firmware implements the encapsulation of functions and the standardization of interfaces.

[0058] The configuration module provides menu options through the user interface, allowing users to select the desired functional modules. It also utilizes the RT-Thread system's env menu function to implement the configuration interface, enabling users to select and customize functional modules according to their needs.

[0059] The project refactoring and compilation module is used to dynamically configure firmware code and compile it to generate and run the firmware according to the user's selection. This includes automatically assembling modular code snippets, as well as automatically refactoring project code and compiling and running the firmware.

[0060] The firmware download and deployment module is used to download the generated firmware code into the memory of the photo printer and deploy it, including implementing the firmware transmission, verification and burning programs;

[0061] The functional testing and debugging module is used to perform functional testing on the deployed photo printer, ensuring that the selected modules work properly, and providing debugging tools and test cases to assist users in functional verification.

[0062] like Figure 3-6 As shown, after the printer starts up, the RTOS in the integrated module immediately begins to work. For example, when processing multiple printing tasks, the RTOS will allocate CPU resources reasonably according to the priority and time requirements of the tasks. For instance, when there are urgent small-sized advertising print jobs and regular large poster print jobs at the same time, the RTOS will ensure that the print head control module and data transmission module of the urgent task get enough CPU time slices to ensure their rapid completion, while also preventing the large poster print job from being stalled for a long time. By dynamically adjusting resource allocation, efficient multi-task processing is achieved, ensuring the stable and coordinated operation of each module and realizing task scheduling, resource management, and communication mechanisms.

[0063] The functional division unit clearly divides the functions of the photo printer into independent modules such as printhead control, color management, and media feeding. For example, in the printhead control module, different control sub-modules have been developed for different types of printheads, such as piezoelectric printheads and thermal inkjet printheads, to achieve precise ink droplet ejection control.

[0064] The firmware development unit develops specific firmware for each module. Taking the color management module as an example, the development team develops firmware that can accurately reproduce colors based on different color standards, such as CMYK and Adobe RGB, and color calibration algorithms. This achieves functional encapsulation and interface standardization, ensuring seamless integration between different modules.

[0065] The module selection unit allows users to choose the required functional modules through the configuration interface based on their own needs. For example, if printing on special materials is frequently required, users can choose a media feed module optimized for vinyl and canvas materials, as well as a high-precision printhead control module and a professional color management module. However, special effects printing function modules that are not frequently used are not selected, thus realizing the customized construction of the system.

[0066] On the control panel of the photo printer, the user interface unit provides intuitive menu options, which are presented in a clear category, such as "Print Function", "Media Settings" and "System Settings". Under the "Print Function" menu, there are further sub-options such as "Print Precision Selection" and "Print Speed ​​Settings". The "Media Settings" menu lists various supported media types and allows users to further set parameters such as the thickness and absorbency of each media. Users can easily select the required function modules through the touch screen or buttons.

[0067] The configuration interface unit utilizes the env menu function of the RT-Thread system. In the configuration interface, users can see a detailed introduction and recommended configuration for each functional module. For example, for the color management module, the configuration interface will display the currently selected color standard, the history of color calibration, and the recommended calibration cycle. Users can adjust and customize according to their actual needs, such as selecting a wider color gamut color standard that is more suitable for printing artworks, and fine-tuning the color parameters according to the effect of the printed sample to achieve personalized functional configuration.

[0068] Depending on the selection made, the code dynamic configuration unit will automatically identify and extract the corresponding module code. For example, when a user selects a specific printhead control module and color management module, the unit will filter out the relevant code for these two modules from the code library and perform preliminary combination and configuration based on the dependencies and interface specifications between the modules.

[0069] The compilation unit then compiles the configured code. During the compilation process, it automatically handles the linking and optimization between modules. For example, it performs targeted optimizations for the frequently interacting printhead control module and data transmission module to reduce data transmission latency and error rate, ultimately generating firmware that can run on the photo printer. The whole process is fast and efficient, achieving dynamic configuration and compilation.

[0070] The firmware code generated by the firmware transmission unit is transmitted to the memory of the photo printer via the JLINK kit. During the transmission process, a reliable verification and retransmission mechanism is used. For example, if a data error is detected during the transmission, the firmware transmission unit will automatically request the retransmission of the erroneous data block to ensure the integrity of the firmware code.

[0071] The verification and burning unit verifies and burns the firmware transmitted to the memory. The verification and burning unit checks the integrity and compatibility of the firmware, such as whether the firmware version number is compatible with the hardware of the photo printer, and whether the firmware file size and checksum are correct. After confirming that there are no errors, the firmware is burned to the designated storage area, and a self-test is performed after the burning is completed to ensure that the photo printer can start and run the new firmware normally.

[0072] After the new firmware is deployed on the photo printer, the functional testing unit will automatically run a series of test cases. For example, for the printhead control module, it will perform printhead inkjet tests to check whether the size of the ink droplets, the ejection frequency, and the ejection angle meet the standards; for the color management module, it will print standard color test samples and use a color measuring instrument to detect the color accuracy and color uniformity of the printed samples; for the media feed module, it will perform feed tests on media of different materials to check whether the media feed speed and positioning accuracy meet the requirements and ensure that the selected module works normally.

[0073] When the debugging tool provider discovers a problem, it provides technicians with a wealth of debugging tools and test cases. For example, it provides a real-time system log viewing function, allowing technicians to view the running status and error information of each module; it also provides a test tool for simulating printing tasks, allowing technicians to simulate printing under different parameter settings, quickly locate the problem, and fix it by modifying the corresponding module code or configuration parameters.

[0074] The functional division module includes:

[0075] Functional division unit is used to divide the functions of the photo printer into independent modules, including printhead control, color management and media feeding;

[0076] The firmware development unit is used to develop specific firmware for each module, thereby encapsulating functions and standardizing interfaces.

[0077] The module selection unit is used to select the appropriate functional modules to be added to the system construction according to user needs.

[0078] The configuration module includes:

[0079] User interface unit, used to provide menu options for users to select the required functional modules;

[0080] The configuration interface unit is used to implement the configuration interface using the env menu function of the RT-Thread system, allowing users to select and customize functional modules according to their needs.

[0081] The project refactoring and compilation module includes:

[0082] The code dynamic configuration unit is used to dynamically configure firmware code based on user selections;

[0083] The compilation and generation unit is used to compile and generate the firmware for running, including automatically assembling modular code snippets, automatically refactoring project code, and compiling and running the firmware.

[0084] The firmware download and deployment module includes:

[0085] Firmware transmission unit, used to download the generated firmware code into the memory of the photo printer;

[0086] The verification and burning unit is used to verify the firmware and burn the program.

[0087] The functional testing and debugging module includes:

[0088] The functional testing unit is used to test the functionality of the deployed photo printer to ensure that the selected modules work properly.

[0089] The debugging tool provider unit provides debugging tools and test cases to assist users in functional verification.

[0090] Example 2

[0091] A photo printer control method based on the RT-Thread driver framework, such as Figure 2 As shown, it includes the following steps:

[0092] S1: Utilize the multitasking and real-time processing capabilities of the RTOS to coordinate the operation of various modules and realize task scheduling, resource management, and communication mechanisms.

[0093] S2: Divide the functions of the photo printer into independent modules, including printhead control, color management and media feeding, and develop specific firmware for each module to achieve functional encapsulation and interface standardization;

[0094] S3: Provides menu options through the user interface, allowing users to select the required functional modules, and utilizes the RT-Thread system's env menu function to implement a configuration interface, allowing users to select and customize functional modules according to their needs;

[0095] S4: User selection, dynamic configuration of firmware code and compilation to generate and run the firmware, including automatic assembly of modular code snippets, as well as automatic refactoring of project code and compilation and running of firmware;

[0096] S5: Download the generated firmware code into the memory of the photo printer and deploy it, including implementing the firmware transmission, verification and burning program;

[0097] S6: Perform functional testing on the deployed photo printer to ensure that the selected modules work properly, and provide debugging tools and test cases to assist users in verifying the functionality.

[0098] A computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the photo printer control method based on the RT-Thread driver framework described above.

[0099] An electronic device includes a processor and a memory, the memory storing a computer program executable on the processor, the computer program being executed by the processor to implement the steps of the photo printer control method based on the RT-Thread driver framework described above.

[0100] When the photo printer starts up, the capabilities of the RTOS enable multiple modules such as print job management, printhead control, and color calibration to work together. For example, when there are multiple poster printing jobs at the same time, the RTOS allocates resources reasonably to ensure that each job is carried out in an orderly manner and that other jobs are not slowed down because one job consumes too many resources.

[0101] The functions of the photo printer are divided into independent modules and specific firmware is developed. For example, for the color management module, the developers develop precise color calibration and conversion algorithms based on the company's commonly used CMYK color mode and specific color preferences, realize functional encapsulation and interface standardization, and ensure the accuracy and stability of color output.

[0102] The user interface of the photo printer displays menu options such as "print precision settings", "color mode selection" and "media type adaptation". According to the poster design requirements, the user can use the RT-Thread system's env menu function to enter the configuration interface, select the high-precision printhead control module and the color management module suitable for the color performance of the advertisement, and customize relevant parameters such as print resolution and color saturation.

[0103] Based on the user's selection, the system automatically extracts code snippets of the corresponding modules from the code library, assembles and refactors the project code, compiles and generates firmware suitable for this task, and downloads it to the photo printer's memory. During the transmission process, it performs rigorous verification to ensure that the code is complete and error-free before burning it.

[0104] After deployment, perform functional tests on the photo printer. Print a test poster to check if the colors are accurate, the image is clear, and the media feed is smooth. If any problems are found, technicians can quickly locate the problem using the provided debugging tools and test cases. For example, the color deviation may be caused by printhead clogging, or the parameters of the media feed motor may be incorrectly set. Then, make the corresponding adjustments and repairs to ensure that the photo printer can meet business needs.

[0105] Overall technical solution implementation process

[0106] 1. Selection of equipment and functions for a photo printer:

[0107] The UI displays options based on production needs. Select the required functional modules. For example, if the photo printer solution requires brushless DC motor control values, then the MTR3A module can be selected. Use the RT-Thread env tool to access the configuration menu and check the necessary device functions. The device is identified by a unique 7-digit identifier composed of class, version, and numbers. For example, the third servo control motor module for the photo printer is MTR3A03, as explained below:

[0108] MTR: Photo printer motor equipment; the first three characters indicate the type of equipment.

[0109] 1: BLDC motor, the 4th character indicates the subclass: Class 1 - Servo motor; Class 2 - DC motor; Class 3 - BLDC motor; Class 4 - ...;

[0110] A: Feature version A, the 5th character is the code iteration version.

[0111] 03: The 3rd motor, the 6th and 7th characters are the serial number of the device (decimal).

[0112] The ENV menu allows you to directly select devices for rapid system code building, as shown in the menu page below. Figure 7 As shown:

[0113] The ENV menu will open the corresponding selection macros in the rtconfig.h file based on the configuration code in the Kconfig file.

[0114]

[0115]

[0116] 2. Modular functional code:

[0117] Each device has a function .c file, which depends on the selection macro generated by the menu to determine whether it is included in the project's build system. The internal functional code of the file also depends on the macro selection to determine whether it is valid code.

[0118] / * Modularization Case Study of Photo Printer Motor Equipment * /

[0119] #include"rtconfig.h"

[0120] / / Which macros are already enabled for access selection?

[0121] #ifdefined(DEVDRV_MTR3A)

[0122] / / If the menu is configured for MTR3A, then all the code below will be enabled.

[0123] / * Expand the motor's functional code, ensuring consistency in the external interfaces of MTR1, 2, and 3, and the module can be inserted into the project. * /

[0124] #endif

[0125] 3. Build the photo printer code:

[0126] The modular code building of the photo printer relies on the Sconstruct mechanism. After the menu is saved, it will add all the folder files under the open option to the system's build based on the sconscript text written in Python. You only need to classify different motor devices into modules according to their identifiers to quickly insert them into the project.

[0127]

[0128] 4. Code generation:

[0129] After configuring the linker files and cross-compilation environment, you can use the RT-Thread env tool with scons to dynamically generate or configure firmware code directly, such as... Figure 8 As shown.

[0130] 5. Firmware Download and Deployment:

[0131] The generated firmware code is transferred to the photo printer via the JLINK kit and stored in non-volatile memory. Because the JLINK kit supports command-line control, it can achieve fully automated debugging technology. By editing the batch file, a series of command-line operations such as opening JFLASH, burning the bin file, and starting the APP can be added to the batch file.

[0132] / * Control firmware burning and execution via batch file * /

[0133] cd / d"C:\Program Files\SEGGER\JLink"

[0134] JFlash.exe

[0135] -openprjC:\Desktop\JFLASH_project\1.jflash-openE:\rtthread.bin,0x00000000-auto-startapp-exit

[0136] 6. System Initialization:

[0137] When the photo printer starts up, the RTOS initializes the system environment and loads the necessary drivers and services.

[0138] 7. Modular test cases:

[0139] RT-Thread provides a dedicated testing framework that can accept the test case name, function reference, initialization function, cleanup function, and priority as parameters, and register the test case internally, such as:

[0140]

[0141]

[0142] In this way, when the unit testing framework runs, it will find all test cases registered using UTEST_TC_EXPORT and execute them in the specified order. 8. Functional Debugging:

[0143] RT-Thread utilizes its MSH (Module Shell) mechanism to execute and manage modules within the printer firmware, including loading, unloading, and querying module status. Users can interact with the RT-Thread system by entering various commands through the MSH command line to monitor and control the system. Figure 9 As shown.

[0144] By entering the module's test symbol in the shell using pre-registered test cases, rt-thread will find the corresponding photo printer test cases and execute them in sequence. Users can view the photo printer's test return results and perform quick debugging through MSH.

[0145] The same or similar labels correspond to the same or similar parts;

[0146] The terms used to describe positional relationships in the accompanying drawings are for illustrative purposes only and should not be construed as limiting this patent.

[0147] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not intended to limit the implementation of the present invention. For those skilled in the art, other variations or modifications can be made based on the above description. It is neither necessary nor possible to exhaustively list all implementation methods here. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the claims of the present invention.

Claims

1. A photo printer control system based on the RT-Thread driver framework, characterized in that, include: The integration module is used to leverage the multitasking and real-time processing capabilities of the RTOS, coordinate the operation of various modules, and implement task scheduling, resource management, and communication mechanisms. The functional division module is used to divide the functions of the photo printer into independent modules and develop specific firmware for each module. The firmware implements the encapsulation of functions and the standardization of interfaces. The configuration module provides menu options through the user interface, allowing users to select the desired functional modules. It also utilizes the RT-Thread system's env menu function to implement the configuration interface, enabling users to select and customize functional modules according to their needs. The project refactoring and compilation module is used to dynamically configure firmware code and compile it to generate and run the firmware according to the user's selection. This includes automatically assembling modular code snippets, as well as automatically refactoring project code and compiling and running the firmware. The firmware download and deployment module is used to download the generated firmware code to the memory of the photo printer and deploy it, including implementing the firmware transmission, verification and burning programs; The functional testing and debugging module is used to perform functional testing on the deployed photo printer, ensuring that the selected modules work properly, and providing debugging tools and test cases to assist users in functional verification. The functional division module includes: The functional division unit is used to divide the functions of the photo printer into independent modules, including printhead control, color management and media feeding; The firmware development unit is used to develop specific firmware for each module, thereby encapsulating functions and standardizing interfaces. The module selection unit is used to select the appropriate functional modules to be added to the system construction according to user needs.

2. The photo printer control system based on the RT-Thread driver framework according to claim 1, characterized in that, The configuration module includes: User interface unit, used to provide menu options for users to select the required functional modules; The configuration interface unit is used to implement the configuration interface using the env menu function of the RT-Thread system, allowing users to select and customize functional modules according to their needs.

3. The photo printer control system based on the RT-Thread driver framework according to claim 1, characterized in that, The project refactoring and compilation module includes: The code dynamic configuration unit is used to dynamically configure firmware code based on user selections; The compilation and generation unit is used to compile and generate the firmware for running, including automatically assembling modular code snippets, automatically refactoring project code, and compiling and running the firmware.

4. The photo printer control system based on the RT-Thread driver framework according to claim 1, characterized in that, The firmware download and deployment module includes: Firmware transmission unit, used to download the generated firmware code into the memory of the photo printer; The verification and burning unit is used to verify the firmware and burn the program.

5. The photo printer control system based on the RT-Thread driver framework according to claim 1, characterized in that, The functional testing and debugging module includes: The functional testing unit is used to test the functionality of the deployed photo printer to ensure that the selected modules work properly. The debugging tool provider unit provides debugging tools and test cases to assist users in functional verification.

6. A photo printer control method based on the RT-Thread driver framework, based on the photo printer control system according to any one of claims 1-5, characterized in that, Includes the following steps: S1: Utilize the multitasking and real-time processing capabilities of the RTOS to coordinate the operation of various modules and realize task scheduling, resource management, and communication mechanisms. S2: Divide the functions of the photo printer into independent modules, including printhead control, color management and media feeding, and develop specific firmware for each module to achieve functional encapsulation and interface standardization; S3: Provides menu options through the user interface, allowing users to select the required functional modules, and utilizes the RT-Thread system's env menu function to implement a configuration interface, allowing users to select and customize functional modules according to their needs; S4: User selection, dynamically configure firmware code and compile to generate and run the firmware, including automatically assembling modular code snippets, and automatically refactoring project code, compiling and running firmware; S5: Download the generated firmware code into the memory of the photo printer and deploy it, including implementing the firmware transmission, verification and burning procedures; S6: Perform functional testing on the deployed photo printer to ensure that the selected modules work properly, and provide debugging tools and test cases to assist users in verifying the functionality.

7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method as described in claim 6.

8. An electronic device, characterized in that, It includes a processor and a memory, the memory storing a computer program that can run on the processor, the computer program implementing the method of claim 6 when executed by the processor.

Citation Information

Patent Citations

  • Industrial control program development platform and method

    WO2024140416A1