CN100414480C - Control method and its device for preventing error cut-off machine - Google Patents
Control method and its device for preventing error cut-off machine Download PDFInfo
- Publication number
- CN100414480C CN100414480C CNB2006100345286A CN200610034528A CN100414480C CN 100414480 C CN100414480 C CN 100414480C CN B2006100345286 A CNB2006100345286 A CN B2006100345286A CN 200610034528 A CN200610034528 A CN 200610034528A CN 100414480 C CN100414480 C CN 100414480C
- Authority
- CN
- China
- Prior art keywords
- cpu
- power key
- machine
- message
- control method
- 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.)
- Expired - Fee Related
Links
Images
Abstract
The present invention discloses a control method for preventing mistaken close-downs, which comprises the following steps: (1), whether an action message of a power supply key exists is judged according to a generated message, and if the action message does, a step (2) is executed; (2), whether pressed action of the power supply key exists is judged, if the pressed action does, a step (3) is executed, and if the pressed action does not, a step (4) is executed; (3), 1 is disassembled in a variable PowerFlag, and the step (1) is executed; (4), whether the variable PowerFlag is 1 is judged, if the PowerFlag is 1, a step (5) is executed, and if the PowerFlag is not 1, the step (1) is executed; (5), whether release action of the power supply key exists is judged, if the release action does, a close-down instruction is executed, and if the release action does not, the step (1) is executed. A control device which adopts the control method for preventing mistaken close-downs comprises a CPU with a power control module and an off-on control circuit which is connected to the CPU power control module. The present invention can completely prevent a system from being turned off by mistake when the system is turned on.
Description
[technical field]
The present invention relates to a kind of method of operating and device thereof of digital product, relates to a kind of control method that prevents error cut-off machine and the device thereof that can effectively discern button operation specifically.
[background technology]
Please refer to Fig. 1, the existing circuit diagram that prevents error cut-off machine, the action that prevents error cut-off machine of these embedded systems is to handle by the signal of two pins of CPU, as shown in Figure 1, R5 and C4 parallel connection strobe, C3 is a shunt capacitance, filters spiking, when power key SW2 presses, R4, R6 and R7 form bleeder circuit, and the signal PWR_ON that produces high level informs the energy supply control module start of CPU; Simultaneously, triode Q1 conducting, PWR_OFF is a low level; After the start, the pin of system by detecting PWR_OFF whether low level judged user's action of whether shutting down, and can prevent that system mistake ground from shutting down, and opens or closes motor-driven work but need control with two pins, too much takies the pin resource of CPU.
Chinese patent application 03102413.0 discloses a kind of key control device and method, this key control device and method can prevent the problem of palm PC maloperation or false triggering, but its disclosed key control device structure is comparatively complicated, this button control method need be judged repeatedly output or input state, and blockade or deblock state, very complicated.
Therefore, prior art is improved, provided a kind of and can effectively discern button operation, prevent that the control method of error cut-off machine and device thereof are real in necessary.
[summary of the invention]
The purpose of this invention is to provide a kind of simple to operate, identification and prevent the control method and the device thereof of error cut-off machine accurately.
To achieve these goals, the present invention adopts following technical scheme:
A kind of control method that prevents error cut-off machine is provided, and it adopts the CPU with energy supply control module, and this control method that prevents error cut-off machine may further comprise the steps, and wherein step (2) to step (5) is to be handled by the power key function:
(1) judging whether the power key action message according to the message that produces, is then to enter step (2);
(2) call power key function among the CPU, judged whether that power key depresses action, be then to enter step (3), otherwise enter step (4);
(3) the variable PowerFlag at the power key function writes down 1, and returns step (1);
(4) whether the variable PowerFlag that judges the power key function is 1, is then to enter step (5), otherwise returns step (1);
(5) judging whether the power key release movement, is then to carry out shutdown command, otherwise returns step (1).
Described message is to be produced by the message generator, and each message is represented an incident, and each incident all has a function to respond this incident.So, such as, do an actuation of keys, to respond the incident of this actuation of keys so, to should being arranged, a function responds this incident.A lot of incidents is arranged like this, the function of a lot of correspondences is also just arranged.
The message generator produces these message: as the message that timer interrupts generation, and the message that external interrupt produces, the message that actuation of keys produces, the message that UART (serial ports) produces when transceive data is finished, message of the interruption that DMA produces or the like.
Each message all has the function of a correspondence to go response, when the message of power key action, has a power key function to go to handle, and carries out function corresponding.
In power key function HCE_ReadPowerOnOffButton, judge whether power key is to depress action, is then to write down 1 at variable PowerFlag, otherwise continue to carry out other message of response.
If the record that had power key to press before, promptly variable PowerFlag equals 1, and whether be the release movement of power key, be then to send shutdown command if detecting, and tells the state that system preserves needs preservation, closes tester in power-down state then.
The present invention also provides a kind of above-mentioned control device that prevents the control method of error cut-off machine that adopts, comprise CPU with energy supply control module, and the ON-OFF control circuit that is connected with this cpu power control module, this ON-OFF control circuit connects and only takies the pin of CPU, cooperate Control Software, can prevent fully that the incident that locking system shuts down mistakenly takes place when start.
This energy supply control module includes switchgear, in order to opening or closing of the power supply that triggers equipment such as digital camera; This switchgear has a low-pass filter, to reduce the spiking of button bounce-back; When pushing button, switch will produce the impact damper of a signal to the Schmidt of PWRON and inside; In case the power supply supply is arranged, CPU will take over each function of system and the management of power supply; The PWRON high-low level signal that embedded software is monitored constantly.
Compared with prior art, the present invention has following beneficial effect:
The present invention prevent the control method of error cut-off machine simple, accurately, can effectively prevent the generation of error cut-off machine, adopt the control device of this control method that prevents error cut-off machine simple in structure, to take resource few.
[description of drawings]
Fig. 1 is the existing circuit diagram that prevents error cut-off machine;
Fig. 2 is the synoptic diagram that the present invention prevents the control device of error cut-off machine;
Fig. 3 is the process flow diagram that the present invention prevents the control method of error cut-off machine.
[embodiment]
Please refer to Fig. 2, the present invention prevents the synoptic diagram of the control device of error cut-off machine, and the present invention prevents that the switchgear of error cut-off machine from only need take a CPU pin, and cooperates Control Software, can prevent fully that locking system shuts down when start mistakenly.This prevents that the control device of error cut-off machine from comprising the CPU with energy supply control module, and the ON-OFF control circuit that is connected with this cpu power control module,
This energy supply control module includes switchgear, in order to opening or closing of the power supply that triggers equipment such as digital camera; This switchgear has a low-pass filter, to reduce the spiking of button bounce-back; When pushing button, switch will produce the impact damper of a signal to the Schmidt of PWRON and inside; In case the power supply supply is arranged, CPU will take over each function of system and the management of power supply; The PWRON high-low level signal that embedded software is monitored constantly.
SW1 is a power key among Fig. 2; C1 and R1 form the peaked wave circuit that produces when the filtration button is pressed; Bleeder circuit when R2 and R3 composition button are pressed; When button was pressed, the energy supply control module that produces high level signal notice CPU was opened digital camera; C2 is a shunt capacitance.Aforementioned common composition ON-OFF control circuit, this ON-OFF control circuit connects the pin of CPU.
See also Fig. 3, the present invention prevents that the control method of error cut-off machine from being:
At first actuation of keys produces an incident, and each message is represented an incident, and described message is to be produced by the message generator, and each incident all has a function to respond this incident.After the power key action message produces, carry out following steps:
(1) judging whether the power key action message according to the message that produces, is then to enter step (2);
(2) judged whether that power key depresses action, be then to enter step (3), otherwise enter step (4);
(3) write down 1 at variable PowerFlag, and return step (1);
(4) whether judgment variable PowerFlag is 1, is then to enter step (5), otherwise returns step (1);
(5) judging whether the power key release movement, is then to carry out shutdown command, otherwise returns step (1).
Step (2) to step (5) is to be handled by the power key function.
The message structure of the digital camera in the present embodiment:
void?HceProc(ULONG?ulArgument)
{
......
......
......
while(true)
{
......
switch(uwMsgId)
{
case?HM_CREATE:
......
case?HM_ADC0_NOTIFICATION:
// by five message to the key generation
case?HM_ADC4_NOTIFICATION:
// press ZoomIn/ZoomOut/Menu/Delete/Display message
case?HM_XL_GPIO_BUTTON_NOTIFICATION:
case?HM_FG_GPIO_BUTTON_NOTIFICATION:
case?HM_FS_GPIO_BUTTON_NOTIFICATION:
// press the message that S1/S2 produces
case?HM_DVG_GPIO_BUTTON_NOTIFICATION:
case?HM_LG_GPIO_BUTTON_NOTIFICATION:
case?HM_AUD_GPIO_BUTTON_NOTIFICATION:
The message that //playback/still/movie key produces
case?HM_PWRC_BUTTON_NOTIFICATION:
// press message that power key produces to carry out and handle function
HCE_ReadPowerOnOffButton();
......
}
}
}
Being implemented as follows of the program of present embodiment:
void?HCE_ReadPowerOnOffButton()
{
If (uwMsgParam==1) // power key is depressed
{
BPowerFlag=1; // depress action, mark 1
sCurrButtons.sState.bPower=BUTTON_PRESSED;
}
Whether if (bPowerFlag==1) // inspection power key has the action of depressing earlier
{
If (uwMsgParam==0) // power key discharges
{
bPowerFlag=0;
sCurrButtons.sState.bPower=BUTTON_RELEASED;
sHCEModesStatus.bPowerOff=TRUE;
// tell system to go to carry out the shutdown action
}
}
return;
}
In power key function HCE_ReadPowerOnOffButton, judge whether power key is to depress action, is then to write down 1 at variable PowerFlag, otherwise continue to carry out other message of response.
If the record that had power key to press before, promptly variable PowerFlag equals 1, and whether be the release movement of power key, be then to send shutdown command if detecting, and tells the state that system preserves needs preservation, closes tester in power-down state then.
Claims (6)
1. a control method that prevents error cut-off machine is characterized in that, it adopts the CPU with energy supply control module, and this control method that prevents error cut-off machine may further comprise the steps, and wherein step (2) to step (5) is to be handled by the power key function:
(1) judging whether it is the power key action message according to the message that produces, is then to enter step (2);
(2) call power key function among the CPU, judged whether that power key depresses action, be then to enter step (3), otherwise enter step (4);
(3) the variable PowerFlag at the power key function writes down 1, and returns step (1);
(4) whether the variable PowerFlag that judges the power key function is 1, is then to enter step (5), otherwise returns step (1);
(5) judging whether the power key release movement, is then to carry out shutdown command, otherwise returns step (1).
2. the control method that prevents error cut-off machine as claimed in claim 1 is characterized in that, described message is to be produced by the message generator.
3. the control method that prevents error cut-off machine as claimed in claim 1 is characterized in that, this method adopts ON-OFF control circuit, and this ON-OFF control circuit connects the pin of CPU, is connected with this cpu power control module.
4. one kind is adopted the control device that prevents the control method of error cut-off machine as claimed in claim 1, it is characterized in that, it comprises the described CPU with described energy supply control module, and the ON-OFF control circuit that is connected with the energy supply control module of this CPU, this ON-OFF control circuit connects the pin of CPU.
5. control device as claimed in claim 4 is characterized in that this energy supply control module includes switchgear, in order to trigger opening or closing of power supply.
6. control device as claimed in claim 5 is characterized in that this switchgear includes low-pass filter, to reduce the spiking of button bounce-back.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNB2006100345286A CN100414480C (en) | 2006-03-21 | 2006-03-21 | Control method and its device for preventing error cut-off machine |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNB2006100345286A CN100414480C (en) | 2006-03-21 | 2006-03-21 | Control method and its device for preventing error cut-off machine |
Publications (2)
Publication Number | Publication Date |
---|---|
CN1821931A CN1821931A (en) | 2006-08-23 |
CN100414480C true CN100414480C (en) | 2008-08-27 |
Family
ID=36923331
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CNB2006100345286A Expired - Fee Related CN100414480C (en) | 2006-03-21 | 2006-03-21 | Control method and its device for preventing error cut-off machine |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN100414480C (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101951625B (en) * | 2010-09-30 | 2013-03-06 | 成都三零瑞通移动通信有限公司 | Mobile phone on and off security detection and control device and method |
CN112015255A (en) * | 2020-07-08 | 2020-12-01 | 深圳市智微智能科技股份有限公司 | Method and system for fast shutdown without input equipment |
CN114924636B (en) * | 2022-06-01 | 2023-03-21 | 北京华电众信技术股份有限公司 | Post-shutdown self-starting circuit for low-side X86 processor |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5339444A (en) * | 1990-11-27 | 1994-08-16 | Kabushiki Kaisha Toshiba | Portable computer resetting resume error caused from HDD loaded condition being changed and starting OS |
CN1320853A (en) * | 2000-04-21 | 2001-11-07 | 船井电机株式会社 | Power on/off circuit device with reset function |
CN2478167Y (en) * | 2000-12-28 | 2002-02-20 | 成都四方信息技术开发公司 | Computer power supply device preventing error operation |
CN1521624A (en) * | 2003-01-27 | 2004-08-18 | 联想(北京)有限公司 | Press key control device and method |
CN2722304Y (en) * | 2004-07-08 | 2005-08-31 | 上海环达计算机科技有限公司 | Power supply switch adjusting circuit of manual information processor |
-
2006
- 2006-03-21 CN CNB2006100345286A patent/CN100414480C/en not_active Expired - Fee Related
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5339444A (en) * | 1990-11-27 | 1994-08-16 | Kabushiki Kaisha Toshiba | Portable computer resetting resume error caused from HDD loaded condition being changed and starting OS |
CN1320853A (en) * | 2000-04-21 | 2001-11-07 | 船井电机株式会社 | Power on/off circuit device with reset function |
CN2478167Y (en) * | 2000-12-28 | 2002-02-20 | 成都四方信息技术开发公司 | Computer power supply device preventing error operation |
CN1521624A (en) * | 2003-01-27 | 2004-08-18 | 联想(北京)有限公司 | Press key control device and method |
CN2722304Y (en) * | 2004-07-08 | 2005-08-31 | 上海环达计算机科技有限公司 | Power supply switch adjusting circuit of manual information processor |
Also Published As
Publication number | Publication date |
---|---|
CN1821931A (en) | 2006-08-23 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP2506114B1 (en) | Method and device for intelligent terminal reset | |
CN204759081U (en) | Switching on and shutting down system | |
CN102681784A (en) | Method and device for operating mobile terminal on basis of sensor, and mobile terminal | |
CN103439948B (en) | Transformer substation protection pressure plate intelligent operation and supervisory system | |
CN100414480C (en) | Control method and its device for preventing error cut-off machine | |
CN101087130B (en) | Audio device protection system | |
CN103207655A (en) | Mobile terminal with reset function and reset method | |
CN101146289A (en) | Apparatus and method for reset in mobile terminal | |
CN103942509A (en) | Anti-counterfeiting recognition device provided with self-destructive protection assembly and self-destructive protection method | |
CN101335514A (en) | Safe switching apparatus and switching method for system on chip | |
CN102063172A (en) | Forced power off circuit | |
CN107798246A (en) | One kind is based on the credible detection method and device of server | |
CN103942059A (en) | Electronic device with multiple starting modes | |
CN104462953B (en) | A kind of information processing method and electronic equipment | |
CN102722120A (en) | Instrument keyboard controller with ultralow power consumption | |
US20170017339A1 (en) | Touch-controlled electronic device and operating method thereof | |
CN201021993Y (en) | A touch screen device with touch pen | |
CN106445046A (en) | Computer equipment and method for switching on and switching off computer equipment | |
CN101256518A (en) | Method and apparatus for preventing host system from power-off illegally due to misoperation | |
CN112526898A (en) | Serial port line plug detection circuit and embedded equipment | |
CN103092711B (en) | The circuit breaking controlling method of electronic equipment and system and startup control method and system | |
CN105893875B (en) | Method for preventing the maloperation of the intelligent electronic device external world and its device | |
TWI621046B (en) | Touch sensitive electronic device, touch sensitive processing apparatus and method thereof | |
CN211202068U (en) | Turbine ETS system | |
CN203827309U (en) | Reset signal generating circuit and electronic apparatus |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
C17 | Cessation of patent right | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20080827 |