xmega32a4u_board.rar

  • BinteK
    了解作者
  • C/C++
    开发工具
  • 214KB
    文件大小
  • rar
    文件格式
  • 0
    收藏次数
  • 1 积分
    下载积分
  • 0
    下载次数
  • 2020-07-21 22:54
    上传日期
Programas y librerias utiles para micros ATMEGA32
xmega32a4u_board.rar
内容介绍
/* * mnu.c * * Created: 15/03/2013 8:27:18 * Author: Emilio */ #include "mnu.h" void run_mnu() { display_refress++; On_startUp(); set_defaults(); Seleccionar_idioma(); Funciones_diagnostico(); mnuPrincipal(); Editar_programa(); mnu_diagnostico(); if(ready_to_start) mnu_trabajo(); if(!factory_setup & !param_save) Error_msg(); } /****************************************************************************** *Representa en pantalla el mensaje de error correspondiente ******************************************************************************/ void Error_msg() { averia_last = averia; averia = proceso.error; if((proceso.error==0) && (averia_last > averia)) ready_to_start = true; //solo en el flanco de error if(proceso.error==0) return; ready_to_start = false; if(proceso.error & 16) { strcpy(lcd_buffer_H," HOT WATER "); strcpy(lcd_buffer_L," WAIT "); } if(proceso.error & 8) { strcpy(lcd_buffer_H," MOSFETS HOT "); strcpy(lcd_buffer_L," WAIT "); } if(proceso.error & 4) { strcpy(lcd_buffer_H," OVERVOLTAGE "); strcpy(lcd_buffer_L," RESET "); if(PULSADOR_OK) { while(PULSADOR_OK)asm("wdr"); proceso.error &= ~4; TRANSISTORS_OFF(); // IGBT OFF scr_cntrl.scr1_pulse = false; scr_cntrl.scr2_pulse = false; flags.heating = false; ready_to_start = true; strcpy(cadena_low,"INC START EDIT "); return_to_main(); } } if(proceso.error & 2) { strcpy(lcd_buffer_H," OVERCURRENT "); strcpy(lcd_buffer_L," RESET "); if(PULSADOR_OK) { while(PULSADOR_OK)asm("wdr"); proceso.error &= ~2; TRANSISTORS_OFF(); // IGBT OFF scr_cntrl.scr1_pulse = false; scr_cntrl.scr2_pulse = false; flags.heating = false; ready_to_start = true; strcpy(cadena_low,"INC START EDIT "); return_to_main(); } } send_to_lcd_rs485(2); } /******************************************************************************* * Solo se puede ejecutar al arrancar el equipo. * en los dos primeros segundos. *******************************************************************************/ void On_startUp() { if(start_up) { while(counter_lengua < 26000) { asm("wdr"); counter_lengua++; if(PULSADOR_1) { lenguaje_set=true; start_up=false; } if(PULSADOR_3) { factory_setup=true; start_up=false; } if(PULSADOR_OK) { diagnostic=true; start_up=0; } } if(start_up) { start_up = false; return_to_main(); } } } /******************************************************************************* * Solo se puede ejecutar al arrancar el equipo. Si se oprime el botón central * en los dos primeros segundos. *******************************************************************************/ void Funciones_diagnostico() { if(diagnostic) // Si se pulsó el boton central { program_select=0; strcpy(lcd_buffer_H," DIAGNOSTICO "); strcpy(lcd_buffer_L," OK "); diagnostic = false; send_to_lcd_rs485(2); diagnostic1 = true; } /********************************************************************/ // Menu de diagnostico if(diagnostic1) { if(PULSADOR_OK) { diagnostic1 = false; while(PULSADOR_OK ) asm("wdr"); ready_to_start=0; diagn_mnu = true; } } /********************************************************************/ } void mnu_diagnostico() { if(!diagn_mnu) return; diagn_screen(); } void diagn_screen() { if(PULSADOR_1) { while(PULSADOR_1)asm("wdr"); ACA.CTRLB++; eeprom_write_byte(&parametros_eep.V_max,ACA.CTRLB); } if(PULSADOR_3) { while(PULSADOR_3)asm("wdr"); ACA.CTRLB--; eeprom_write_byte(&parametros_eep.V_max,ACA.CTRLB); } if(!(PULSADOR_OK)) { while(PULSADOR_OK)asm("wdr"); //diagn_mnu = false; //return_to_main(); } Display_update(); } void Display_update() { strcpy((char *)lcd_buffer_H," V COMPARATOR "); lcd_buffer_L[0] = ' '; lcd_buffer_L[1] = ' '; char_to_bcd(ACA.CTRLB); lcd_buffer_L[2] = digitos.centenas; lcd_buffer_L[3] = digitos.decenas; lcd_buffer_L[4] = digitos.unidades; lcd_buffer_L[5] = ' '; lcd_buffer_L[6] = ' '; lcd_buffer_L[7] = 0x20; lcd_buffer_L[8] = ' '; lcd_buffer_L[9] = ' '; lcd_buffer_L[10] = ' '; lcd_buffer_L[11] = ' '; lcd_buffer_L[12] = ' '; lcd_buffer_L[13] = '.'; lcd_buffer_L[14] = ' '; lcd_buffer_L[15] = ' '; send_to_lcd_rs485(2); } /******************************************************************************* * Solo se puede ejecutar al arrancar el equipo. Si se oprime el botón Izquierdo * en los dos primeros segundos. *******************************************************************************/ void Seleccionar_idioma() { if(lenguaje_set) // Si se pulsó el boton izquierdo al arrancar { program_select=0; if(lengua==castellano) { strcpy(lcd_buffer_L,"CAS SALV ING"); strcpy(lcd_buffer_H," CASTELLANO "); } else { strcpy(lcd_buffer_L,"CAS SAVE ENG"); strcpy(lcd_buffer_H," ENGLISH "); } lenguaje_set=0; send_to_lcd_rs485(2); lenguaje_select=1; // Activa menu de selección de lenguaje } /********************************************************************/ //Menu de selección de idioma if(lenguaje_select) { if(PULSADOR_1) { while(PULSADOR_1)asm("wdr"); lengua=castellano; strcpy(lcd_buffer_H," CASTELLANO "); strcpy(lcd_buffer_L,"CAS SALV ING"); send_to_lcd_rs485(2); } if(PULSADOR_3) { lengua=ingles; strcpy(lcd_buffer_H," ENGLISH "); strcpy(lcd_buffer_L,"CAS SAVE ENG"); send_to_lcd_rs485(2); } if(PULSADOR_OK) { while(PULSADOR_OK)asm("wdr"); lenguaje_select = false; return_to_main(); } } } /******************************************************************************* * Solo se puede ejecutar al arrancar el equipo. Si se oprime el botón derecho * en los dos primeros segundos. *******************************************************************************/ void set_defaults() { if(factory_setup) // Si se pulsó boton derecho al arrancar { strcpy(lcd_buffer_H," LOAD DEFAULTS? "); strcpy(lcd_buffer_L," YES FREQ NO "); factory_setup=false; send_to_lcd_rs485(2); param_save=true; // Activa menu "Factory Defaults" } /********************************************************************/ /********************************************************************/ // Menu de Factory Default Parameters if(param_save) { if(PULSADOR_1) { Write_eeprom_defaults(); } if(PULSADOR_OK) { param_save = false; set_freq = true; while(PULSADOR_OK)asm("wdr"); char_to_bcd(parametros.Line_frequency); lcd_buffer_H[0] = 0x20; lcd_buffer_H[1] = 0x20; lcd_buffer_H[2] = digitos.centenas; lcd_buffer_H[3] = digitos.decenas; lcd_buffer_H[4] = digitos.unidades; lcd_buffer_H[5] = 0x20; lcd_buffer_H[6] = 0x20; lcd_buffer_H[7] = 'H'; lcd_buffer_H[8] = 'z'; lcd_buffer_H[9] = '.'; lcd_buffer_H[10] = 0x20; lcd_buffer_H[11] = 0x20; lcd_buffer_H[12] = 0x20; lcd_buffe
评论
    相关推荐
    • ASM.zip
      基于 ASM 的人脸识别程序,包括训练部分。
    • 13059798ASM_version1b12.zip
      很好用的ASM工具箱,有训练集和测试图片,可以运行
    • ASM.rar
      汇编语言程序设计课后习题,含有老师课上布置的课堂作业,对期末考试很有帮助。
    • asm5.0安装包
      asm是assembly的缩写,是汇编的称号,对于java而言,asm就是字节码级别的编程。 而这里说到的asm是指objectweb asm,一种.class的代码生成器的开源项目. ASM是一套java字节码生成架构,它可以动态生成二进制格式的...
    • asm51
      asm51 带有Python3的微型MCS-51汇编器实现
    • oracleasm6.6
      适用与redhat6.6或centos6.6安装oracleasm 包含oracleasm-support-2.1.8-1.el6.x86_64.rpm oracleasmlib-2.0.4-1.el6.x86_64.rpm和 kmod-oracleasm-2.0.8-4.el6_6.x86_64.rpm
    • ASM初级教程.zip
      ASM初级教程,gba arm7编程入门
    • asm-commons.rar
      asm jar包,测试上传,不要下载,切记切记
    • asm-syntax.rar
      syntax add-on for nasm
    • LCD_asm.rar
      primer koda dlya MC at89s52