CN105068842A - Loongson platform based message lamp control method - Google Patents

Loongson platform based message lamp control method Download PDF

Info

Publication number
CN105068842A
CN105068842A CN201510521288.1A CN201510521288A CN105068842A CN 105068842 A CN105068842 A CN 105068842A CN 201510521288 A CN201510521288 A CN 201510521288A CN 105068842 A CN105068842 A CN 105068842A
Authority
CN
China
Prior art keywords
message lamp
message
lamp
sleep
lamp control
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201510521288.1A
Other languages
Chinese (zh)
Inventor
柳玉巧
陈乃阔
吴登勇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shandong Chaoyue Numerical Control Electronics Co Ltd
Original Assignee
Shandong Chaoyue Numerical Control Electronics Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shandong Chaoyue Numerical Control Electronics Co Ltd filed Critical Shandong Chaoyue Numerical Control Electronics Co Ltd
Priority to CN201510521288.1A priority Critical patent/CN105068842A/en
Publication of CN105068842A publication Critical patent/CN105068842A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The invention relates to a Loongson platform based message lamp control method. According to the Loongson platform based message lamp control method, the on and off states of a message lamp are controlled through a control unit, a message lamp control source program is written in the control process and compiled to generate a relocatable object file, and finally a shared library is generated; and an application program directly calls the message lamp control program in the shared library when needing to control the message lamp. According to the Loongson platform based message lamp control method, the message lamp control source program is written and compiled to generate the relocatable object file, the shared library is generated, and the application program directly calls the message lamp control program in the shared library when needing to control the message lamp, so that the demands of different programs on message lamp control are met and the control efficiency of the message lamp is improved.

Description

A kind of message lamp control method based on Loongson platform
Technical field
The present invention relates to message lamp control technology field, particularly a kind of message lamp control method based on Loongson platform under (SuSE) Linux OS.
Background technology
Current most of notebook computer or panel computer all can arrange multiple message pilot lamp, such as, whether hard disk indication lamp is used to indicate hard disk and is reading or processing data, whether WiFi pilot lamp is used to indicate WiFi function and can normally uses, and Battery Indicator Light is for showing the electricity residue situation of battery.By observing relevant pilot lamp, user can the working condition that must obtain related hardware in notebook computer or panel computer directly perceived.
Shared library (dynamic base) is an object module (with .so postfix notation), operationally, can be loaded into arbitrary storage address, and gets up with a program chains in memory, and this process is called dynamic link.Dynamic link is performed by a program being called dynamic linker.After shared library generates, write the header file of a .h, this header file comprises the statement of each function in shared library, only need comprise this header file when user writes application program, just directly can call each function in shared library, realize self-defining upper level applications.
In order to meet the demand that distinct program controls message lamp, improving the efficiency that message lamp controls, the present invention proposes a kind of message lamp control method based on Loongson platform.
Summary of the invention
The present invention, in order to make up the defect of prior art, provides a kind of simple, efficient message lamp control method based on Loongson platform.
The present invention is achieved through the following technical solutions:
A kind of message lamp control method based on Loongson platform, it is characterized in that: convert the voltage signal detected to digital signal by control module and send to message lamp control program, and pass through the command signal of message lamp control program transmission, the light on and off of control message lamp, realize the state comprising initial message lamp, message lamp continues setting three functions of flicker and message lamp flashing times; Realizing the state of described initial message lamp, message lamp continues compose-message lamp in the assignment procedure of flicker and message lamp flashing times and controls source program, and compilation message lamp control source program is generated relocatable file destination, and generates shared library; Application program needs directly to call message lamp control program in shared library during control message lamp.
When the state of initial message lamp, first opening device file, then the state of detect-message lamp, when detecting that the duty of message lamp is normal, then being closed, when the working state abnormal of message lamp being detected, then alarm quitting a program.
When setup message lamp continues flicker, first message lamp is turned on, make message lamp bright, then the sleep(time length of one's sleep is set), message lamp is made to enter sleep pattern, the length of one's sleep sleep(time) terminate after, close message lamp, and then make message lamp enter sleep pattern, the length of one's sleep sleep(time) terminate after, the message lamp flashing times of user's setting whether is reached according to message lamp flashing times, select end process or again turn on message lamp to carry out continuing flicker, until process terminates after the message lamp flashing times of completing user setting.
The invention has the beneficial effects as follows: should based on the message lamp control method of Loongson platform, source program is controlled by compose-message lamp, and compiled generation relocatable file destination, and generate shared library, application program needs directly to call message lamp control program in shared library during control message lamp, meet the demand that distinct program controls message lamp, improve the efficiency that message lamp controls.
Accompanying drawing explanation
Accompanying drawing 1 generates shared library and dynamic link schematic flow sheet for the present invention;
Accompanying drawing 2 is for the present invention is based on the message lamp control method schematic flow sheet of Loongson platform.
Embodiment
Accompanying drawing is a kind of specific embodiment of the present invention, and below in conjunction with accompanying drawing, the present invention is described in detail.
Should based on the message lamp control method of Loongson platform, convert the voltage signal detected to digital signal by control module and send to message lamp control program, and pass through the command signal of message lamp control program transmission, the light on and off of control message lamp, realize the state comprising initial message lamp, message lamp continues setting three functions of flicker and message lamp flashing times; Realizing the state of described initial message lamp, message lamp continues compose-message lamp in the assignment procedure of flicker and message lamp flashing times and controls source program, and compilation message lamp control source program is generated relocatable file destination, and generates shared library; Application program needs directly to call message lamp control program in shared library during control message lamp.
When the state of initial message lamp, first opening device file, then the state of detect-message lamp, when detecting that the duty of message lamp is normal, then being closed, when the working state abnormal of message lamp being detected, then alarm quitting a program.
When setup message lamp continues flicker, first message lamp is turned on, make message lamp bright, then the sleep(time length of one's sleep is set), message lamp is made to enter sleep pattern, the length of one's sleep sleep(time) terminate after, close message lamp, and then make message lamp enter sleep pattern, the length of one's sleep sleep(time) terminate after, the message lamp flashing times of user's setting whether is reached according to message lamp flashing times, select end process or again turn on message lamp to carry out continuing flicker, until process terminates after the message lamp flashing times of completing user setting.
The present invention is based on the message lamp control method of Loongson platform, specific implementation step is as follows:
1, the state of initial message lamp: the status information first reading information lamp, namely under the system that opens file/dev/loongson1-gpio, if open successfully, then according to the GPIO value of message pilot lamp, obtain the state of message lamp, if message lamp duty is normal, then in/dev/loongson1-gpio, writes 0, close message lamp.
2, message lamp is set and continues flicker: the state first reading message lamp, under the system that namely opens file/dev/loongson1-gpio, if open successfully, then according to the GPIO value of message lamp, read the state of message lamp, judge whether message lamp occurs exception; If message lamp is working properly, then allow message lamp bright, namely in/dev/loongson1-gpio, 1 is write, then sleep operation is performed, the message lamp sleep(time bright length of one's sleep) close message pilot lamp afterwards, namely in/dev/loongson1-gpio, write 0, then sleep operation is performed, message lamp is allowed to go out the sleep(time length of one's sleep), circulate this operation, can see that message lamp does not stop flicker.Circulation performs this process n time (n is the message lamp flashing times that user sets), namely can see message lamp flicker n time.
3, after programming terminates, perform compiler directive: gcc-osignallight.o-csignallight.c – fPIC, compiling is by rear fill order: gcc – shared – oliblight.sosignallight.o, finally generates shared library liblight.so.
4, the function name realized in above-mentioned steps is write in light.h header file, when the self-defined application program of user needs control message lamp, only need to comprise light.h header file in a program, and liblight.so is placed on the position at application program source program place.

Claims (3)

1. the message lamp control method based on Loongson platform, it is characterized in that: convert the voltage signal detected to digital signal by control module and send to message lamp control program, and pass through the command signal of message lamp control program transmission, the light on and off of control message lamp, realize the state comprising initial message lamp, message lamp continues setting three functions of flicker and message lamp flashing times; Realizing the state of described initial message lamp, message lamp continues compose-message lamp in the assignment procedure of flicker and message lamp flashing times and controls source program, and compilation message lamp control source program is generated relocatable file destination, and generates shared library; Application program needs directly to call message lamp control program in shared library during control message lamp.
2. the message lamp control method based on Loongson platform according to claim 1, it is characterized in that: when the state of initial message lamp, first open device file, then the state of detect-message lamp, when detecting that the duty of message lamp is normal, then closed, when the working state abnormal of message lamp being detected, then alarm quitting a program.
3. the message lamp control method based on Loongson platform according to claim 1, it is characterized in that: when setup message lamp continues flicker, first message lamp is turned on, make message lamp bright, then the sleep(time length of one's sleep is set), message lamp is made to enter sleep pattern, the length of one's sleep sleep(time) terminate after, close message lamp, and then make message lamp enter sleep pattern, the length of one's sleep sleep(time) terminate after, the message lamp flashing times of user's setting whether is reached according to message lamp flashing times, select end process or again turn on message lamp to carry out continuing flicker, until process terminates after the message lamp flashing times of completing user setting.
CN201510521288.1A 2015-08-24 2015-08-24 Loongson platform based message lamp control method Pending CN105068842A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510521288.1A CN105068842A (en) 2015-08-24 2015-08-24 Loongson platform based message lamp control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510521288.1A CN105068842A (en) 2015-08-24 2015-08-24 Loongson platform based message lamp control method

Publications (1)

Publication Number Publication Date
CN105068842A true CN105068842A (en) 2015-11-18

Family

ID=54498220

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510521288.1A Pending CN105068842A (en) 2015-08-24 2015-08-24 Loongson platform based message lamp control method

Country Status (1)

Country Link
CN (1) CN105068842A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100240980A1 (en) * 2006-01-17 2010-09-23 Xiaohong Zhu Wan-Based Remote Mobile Monitoring Method And Device Of Electrophysiological Data
CN202396070U (en) * 2011-11-29 2012-08-22 苏州市纽克斯照明有限公司 HID (high intensity discharge) electronic ballast operating state control device
CN104507230A (en) * 2014-12-24 2015-04-08 深圳市航盛电子股份有限公司 LED (light emitting diode) lamp meter reading flickering method and system based on STM32 timer

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100240980A1 (en) * 2006-01-17 2010-09-23 Xiaohong Zhu Wan-Based Remote Mobile Monitoring Method And Device Of Electrophysiological Data
CN202396070U (en) * 2011-11-29 2012-08-22 苏州市纽克斯照明有限公司 HID (high intensity discharge) electronic ballast operating state control device
CN104507230A (en) * 2014-12-24 2015-04-08 深圳市航盛电子股份有限公司 LED (light emitting diode) lamp meter reading flickering method and system based on STM32 timer

Similar Documents

Publication Publication Date Title
CN103149526B (en) PCBA board test macro and method
CN108519938B (en) Memory chip compatibility test method, system and test host
CN107015914B (en) Data calibration method and system
CN104572211B (en) The many mirror image loading methods of FPGA programs based on ARM
CN105718281A (en) Touch screen firmware upgrading method and device
CN109582518A (en) It is a kind of for the control method of BIOS debugging mode, device and equipment
CN107544804A (en) The startup method and device of embedded system terminal development mode
CN108170487B (en) Program programming method and device in DSP (digital Signal processor) and vehicle
CN105068842A (en) Loongson platform based message lamp control method
CN103560934A (en) Power line modem production testing method and device
CN105677429A (en) Program burning method, processor and electronic circuit
CN102999422B (en) A kind of high-efficiency embedded type system debug method
CN102567068A (en) System and method for handling kernel mmap call failure
CN112445670B (en) eMMC test method and device
CN110502284A (en) LED light flickering method, device and the readable storage medium storing program for executing of single-chip microcontroller
CN106249666B (en) Online parameter adjusting system and method based on digital communication
CN114416128B (en) Lighting fixture, intelligent control method thereof, computer readable storage medium and equipment
CN107229457B (en) Electronic controller, guide loading method and device thereof and automobile
CN105022647B (en) A kind of control method and terminal of application installation
JP2014120161A (en) System and method for detecting programming process
CN210721449U (en) EEPROM chip program programming device and system
CN106021089B (en) A kind of test method and device of patch interface
CN113238767A (en) Interface multiplexing method, air conditioner external unit and readable storage medium
CN107093408B (en) The control method and device of backlight lightening when smart machine is switched on
CN107506287A (en) The power supply indicator control method and device of a kind of electronic equipment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20151118

RJ01 Rejection of invention patent application after publication