void stop(void) //beginning of stop function { lcd_clear(); //clear LCD display lcd_home(); //set cursor of LCD to the first character position lcd_printf("Stopped"); //print "Stopped" on LCD display PORTA=0; //stop motors }
void HAL_AssertEx() { // cause an abort and let the abort handler take over //*((char*)0xFFFFFFFF) = 'a'; lcd_printf("\f*** ASSERT ****\r\n"); while(true); }
void sk_menu_1_2_1(){ unsigned char scelta,presa; y_pos(1,0); lcd_printf("<< Assegna nomi"); presa=scegli_presa(); assegna_nome(3,2,presa); //x,y }
void AT91_EMAC__status_callback(struct netif *netif) { if(LwipLastIpAddress != netif->ip_addr.addr) { Network_PostEvent( NETWORK_EVENT_TYPE_ADDRESS_CHANGED, 0 ); LwipLastIpAddress = netif->ip_addr.addr; if(!LWIP_STATUS_isset(LWIP_STATUS_MultiCastInit)) { LWIP_STATUS_set(LWIP_STATUS_MultiCastInit); Sockets_LWIP_Driver::InitializeMulticastDiscovery(); } } #if !defined(BUILD_RTM) lcd_printf("\f\n\n\n\n\n\nLink Update: \n"); lcd_printf(" IP: %d.%d.%d.%d\n", (netif->ip_addr.addr >> 0) & 0xFF, (netif->ip_addr.addr >> 8) & 0xFF, (netif->ip_addr.addr >> 16) & 0xFF, (netif->ip_addr.addr >> 24) & 0xFF); lcd_printf(" GW: %d.%d.%d.%d\n", (netif->gw.addr >> 0) & 0xFF, (netif->gw.addr >> 8) & 0xFF, (netif->gw.addr >> 16) & 0xFF, (netif->gw.addr >> 24) & 0xFF); debug_printf("\nLink Update: \r\n"); debug_printf(" IP: %d.%d.%d.%d\r\n", (netif->ip_addr.addr >> 0) & 0xFF, (netif->ip_addr.addr >> 8) & 0xFF, (netif->ip_addr.addr >> 16) & 0xFF, (netif->ip_addr.addr >> 24) & 0xFF); debug_printf(" GW: %d.%d.%d.%d\r\n", (netif->gw.addr >> 0) & 0xFF, (netif->gw.addr >> 8) & 0xFF, (netif->gw.addr >> 16) & 0xFF, (netif->gw.addr >> 24) & 0xFF); #endif }
void lpc24xx_status_callback(struct netif *netif) { if(LwipLastIpAddress != netif->ip_addr.addr) { Network_PostEvent( NETWORK_EVENT_TYPE_ADDRESS_CHANGED, 0 ); LwipLastIpAddress = netif->ip_addr.addr; } #if defined(_DEBUG) lcd_printf("\f\nLink Update: \n"); lcd_printf(" IP: %d.%d.%d.%d\n", (netif->ip_addr.addr >> 0) & 0xFF, (netif->ip_addr.addr >> 8) & 0xFF, (netif->ip_addr.addr >> 16) & 0xFF, (netif->ip_addr.addr >> 24) & 0xFF); lcd_printf(" GW: %d.%d.%d.%d\n", (netif->gw.addr >> 0) & 0xFF, (netif->gw.addr >> 8) & 0xFF, (netif->gw.addr >> 16) & 0xFF, (netif->gw.addr >> 24) & 0xFF); debug_printf("\nLink Update: \r\n"); debug_printf(" IP: %d.%d.%d.%d\r\n", (netif->ip_addr.addr >> 0) & 0xFF, (netif->ip_addr.addr >> 8) & 0xFF, (netif->ip_addr.addr >> 16) & 0xFF, (netif->ip_addr.addr >> 24) & 0xFF); debug_printf(" GW: %d.%d.%d.%d\r\n", (netif->gw.addr >> 0) & 0xFF, (netif->gw.addr >> 8) & 0xFF, (netif->gw.addr >> 16) & 0xFF, (netif->gw.addr >> 24) & 0xFF); #endif }
void updateDisplay() { lcd_gotoxy(0,0); if (parameters[P_CURRENT_STATE] == STATE_OFF) { lcd_puts_p(PSTR(" pSaw Chiller ")); lcd_gotoxy(0,1); lcd_puts_p(PSTR(" Standby ")); return; } else if (parameters[P_CURRENT_STATE] == STATE_ON) { lcd_puts_p(PSTR(" Chiller online ")); } else if (parameters[P_CURRENT_STATE] == STATE_FAN_ON) { lcd_puts_p(PSTR(" Running fan ")); } else if (parameters[P_CURRENT_STATE] == STATE_WARMUP) { lcd_puts_p(PSTR(" Huuuurnggh! ")); } else if (parameters[P_CURRENT_STATE] == STATE_COMPRESSOR_ON) { lcd_puts_p(PSTR(" Compressing! ")); } lcd_gotoxy(0,1); lcd_printf(PSTR("s=%d \xdf" "C o=%d \xdf" "C"), parameters[P_STORE_CURRENT]/10, parameters[P_CIRCULATION_CURRENT]/10); }
static int loadImageFromUsbToRam(const char *pcFileName, void *pvOutBuffer, int *pnOutLength) { long nReadFileSize = 0; int nMaxLength = 0; if (pcFileName==NULL || pvOutBuffer == NULL || pnOutLength==NULL) { debug("[loadImageFromUsbToRam] pcFileName: %p pvOutBuffer: %p pnOutLength: %p\n", pcFileName, pvOutBuffer, pnOutLength); return FALSE; } #ifdef CONFIG_ATMEL_LCD lcd_printf("System is reading image from USB storage, please wait"); #endif nMaxLength = *pnOutLength; memset(pvOutBuffer, 0xFF, nMaxLength); nReadFileSize = file_fat_read(pcFileName, pvOutBuffer, nMaxLength); if (nReadFileSize < 0) { debug("[loadImageFromUsbToRam] pcFileName: %p pvOutBuffer: %p pnOutLength: %p\n", pcFileName, pvOutBuffer, pnOutLength); return FALSE; } debug("[loadImageToRam] pcFileName: %s pvOutBuffer: %d nReadFileSize: %d\n", pcFileName, pvOutBuffer, nReadFileSize); *pnOutLength = nReadFileSize; #ifdef CONFIG_ATMEL_LCD lcd_putc('\n'); #endif return TRUE; }
static void RuntimeFault( const char* szText ) { lcd_printf("\014ERROR:\r\n%s\r\n", szText ); debug_printf( "ERROR: %s\r\n", szText ); HARD_BREAKPOINT(); }
BOOL PXA271_SPI_Driver::nWrite8_nRead8( const SPI_CONFIGURATION& Configuration, UINT8* Write8, INT32 WriteCount, UINT8* Read8, INT32 ReadCount, INT32 ReadStartOffset ) { if(g_PXA271_SPI_Driver.s_All_SPI_port[Configuration.SPI_mod].m_Enabled) { lcd_printf("\fSPI Xaction 1\r\n"); HARD_BREAKPOINT(); return FALSE; } if(!Xaction_Start( Configuration )) return FALSE; { SPI_XACTION_8 Transaction; Transaction.Read8 = Read8; Transaction.ReadCount = ReadCount; Transaction.ReadStartOffset = ReadStartOffset; Transaction.Write8 = Write8; Transaction.WriteCount = WriteCount; Transaction.SPI_mod = Configuration.SPI_mod; Transaction.BusyPin.Pin = GPIO_PIN_NONE; if(!Xaction_nWrite8_nRead8( Transaction )) return FALSE; } return Xaction_Stop( Configuration ); }
uint8_t menu_edit_value(uint8_t v, uint8_t min, uint8_t max) { uint8_t x = lcd_x; uint8_t y = lcd_y; lcd_locate(x, y); lcd_cursor(true); set_busy_led(true); for (;;) { lcd_printf("%02d", v); lcd_locate(x, y); for (;;) { if (get_key_autorepeat(KEY_PREV)) { if (v <= min) v = max; else --v; break; } if (get_key_autorepeat(KEY_NEXT)) { if (v >= max) v = min; else ++v; break; } if (get_key_press(KEY_SEL)) { lcd_cursor(false); set_busy_led(false); return v; } } } }
void Test_Time() { LCD_Clear(); lcd_printf("Testing SSL Time functions...\n"); SYSTEMTIME systime; INT64 getlocaltime = Time_GetLocalTime(); TINYCLR_SSL_PRINTF("Time_GetLocalTime(): %d\n", getlocaltime); Time_ToSystemTime(getlocaltime,&systime); INT64 fromsystemtime = Time_FromSystemTime(&systime); TINYCLR_SSL_PRINTF("Time_FromSystemTime: %d\n", fromsystemtime); time_t time = TINYCLR_SSL_TIME(NULL); TINYCLR_SSL_PRINTF("TINYCLR_SSL_TIME in ms: %d\n", (INT64)time); struct tm *local = TINYCLR_SSL_LOCALTIME(&time); TINYCLR_SSL_PRINTF("Local Time: %s %2d %02d:%02d:%02d %d\n", mon[local->tm_mon-1], local->tm_mday, local->tm_hour, local->tm_min, local->tm_sec, local->tm_year); struct tm *gmtime = TINYCLR_SSL_GMTIME(&time); TINYCLR_SSL_PRINTF("GM Time: %s %2d %02d:%02d:%02d %d\n", mon[gmtime->tm_mon], gmtime->tm_mday, gmtime->tm_hour, gmtime->tm_min, gmtime->tm_sec, gmtime->tm_year); }
BOOL LPC24XX_SPI_Driver::Xaction_Stop( const SPI_CONFIGURATION& Configuration ) { if(g_LPC24XX_SPI_Driver.m_Enabled[Configuration.SPI_mod]) { if(Configuration.CS_Hold_uSecs) { HAL_Time_Sleep_MicroSeconds_InterruptEnabled( Configuration.CS_Hold_uSecs ); } // next, bring the CS to the proper inactive state if(Configuration.DeviceCS != LPC24XX_GPIO::c_Pin_None) { CPU_GPIO_SetPinState( Configuration.DeviceCS, !Configuration.CS_Active ); } g_LPC24XX_SPI_Driver.m_Enabled[Configuration.SPI_mod] = FALSE; } else { lcd_printf("\fSPI Collision 4\r\n"); HARD_BREAKPOINT(); return FALSE; } return TRUE; }
BOOL PXA271_SPI_Driver::nWrite16_nRead16( const SPI_CONFIGURATION& Configuration, UINT16* Write16, INT32 WriteCount, UINT16* Read16, INT32 ReadCount, INT32 ReadStartOffset ) { if(g_PXA271_SPI_Driver.s_All_SPI_port[Configuration.SPI_mod].m_Enabled) { lcd_printf("\fSPI Xaction 1\r\n"); HARD_BREAKPOINT(); return FALSE; } if(!Xaction_Start( Configuration )) return FALSE; { SPI_XACTION_16 Transaction; Transaction.Read16 = Read16; Transaction.ReadCount = ReadCount; Transaction.ReadStartOffset = ReadStartOffset; Transaction.Write16 = Write16; Transaction.WriteCount = WriteCount; Transaction.SPI_mod = Configuration.SPI_mod; if(!Xaction_nWrite16_nRead16( Transaction )) return FALSE; } return Xaction_Stop( Configuration ); }
void __section("SectionForFlashOperations") Native_Profiler_Dump() { lcd_printf("Buffer is full. Dumping...\r\n"); UINT64 time1, time2; time1 = Native_Profiler_TimeInMicroseconds(); USART_Initialize( ConvertCOM_ComPort(USART_DEFAULT_PORT), HalSystemConfig.USART_DefaultBaudRate, USART_PARITY_NONE, 8, USART_STOP_BITS_ONE, USART_FLOW_NONE ); // clear_watchdog // if we do not disable the watchdog, it can be called while we dump data Watchdog_GetSetEnabled( FALSE, TRUE ); // flush existing characters USART_Flush( ConvertCOM_ComPort(USART_DEFAULT_PORT) ); // write string char *offset = (char *)&ProfilerBufferBegin; UINT32 size = (char *)s_native_profiler.position - (char *)&ProfilerBufferBegin; do { UINT32 bytes_written = USART_Write(ConvertCOM_ComPort(USART_DEFAULT_PORT), offset, size); offset += bytes_written; size -= bytes_written; } while(size); // flush new characters USART_Flush( ConvertCOM_ComPort(USART_DEFAULT_PORT) ); Watchdog_GetSetEnabled( TRUE, TRUE ); time2 = Native_Profiler_TimeInMicroseconds(); s_native_profiler.initTime += (time2 - time1); s_native_profiler.position = &ProfilerBufferBegin; *s_native_profiler.position++ = NATIVE_PROFILER_START_TAG; *s_native_profiler.position++ = s_native_profiler.engineTimeOffset; s_native_profiler.writtenData = FALSE; }
/** \brief Informationen auf LCD ausgeben. */ static void update_lcd(void) { uint8_t wpm; irq_disable(); wpm = capture.wpm; irq_enable(); lcd_cursor(0, 0); lcd_printf("mdec-%d.%d", VERSION_MAJOR, VERSION_MINOR); lcd_cursor(0, 10); lcd_printf("%2d WpM", wpm); lcd_cursor(1, 0); lcd_put_mstr(out.text); lcd_commit(); }
int main(int argc, char** argv) { __builtin_mtc0(_CP0_CONFIG, _CP0_CONFIG_SELECT, 0xa4210583); BMXCONbits.BMXWSDRM = 0x0; INTCONbits.MVEC = 0x1; DDPCONbits.JTAGEN = 0; // do your TRIS and LAT commands here ANSELA = 0; // A Analogic off ANSELB = 0; // B Analogic off TRISBbits.TRISB2 = 0; // A4 output TRISAbits.TRISA0 = 0; // A4 output TRISAbits.TRISA4 = 0; // A4 output TRISBbits.TRISB4 = 1; // B4 inuput __builtin_disable_interrupts(); // starts the PINEX __builtin_mtc0(_CP0_CONFIG, _CP0_CONFIG_SELECT, 0xa4210583); BMXCONbits.BMXWSDRM = 0x0; INTCONbits.MVEC = 0x1; DDPCONbits.JTAGEN = 0; __builtin_enable_interrupts(); uart_init(); return 0; start_PWM(); lcd_start(); while(1) { LATAbits.LATA4 = 0; lcd_clearScreen(LCD_COLOR_BLACK); lcd_printf("hello\nworld!",LCD_COLOR_WHITE); //unsigned int t = timer_start(); //while (!timer_timeout(t, 500 * TIMER_MILLISECOND)); blink(); LATAbits.LATA4 = 1; lcd_clearScreen(LCD_COLOR_WHITE); lcd_printf("hello!",LCD_COLOR_BLACK); //t = timer_start(); //while (!timer_timeout(t, 500 * TIMER_MILLISECOND)); } return (EXIT_SUCCESS); }
void Cursor_off(Cursor *cur){ char c = cur->str->string[cur->absolute.x]; lcd_locate(cur->relative.x, cur->relative.y); lcd_setcolor(COL_WHITE); if(c == 0) c = ' '; lcd_printf("%c", c); }
BOOL LPC22XX_SPI_Driver::Xaction_nWrite16_nRead16( SPI_XACTION_16& Transaction ) { lcd_printf("\fSPI Peripheral does not support 16 bit transfer\r\n"); hal_printf("\fSPI Peripheral does not support 16 bit transfer\r\n"); HARD_BREAKPOINT(); return FALSE; }
void lcd_show_board_info(void) { ulong dram_size; int i; char temp[32]; lcd_printf("%s\n", U_BOOT_VERSION); lcd_printf("2015 ATMEL Corp\n"); lcd_printf("%s CPU at %s MHz\n", get_cpu_name(), strmhz(temp, get_cpu_clk_rate())); dram_size = 0; for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++) dram_size += gd->bd->bi_dram[i].size; lcd_printf("%ld MB SDRAM\n", dram_size >> 20); }
static void rom_menu_main(uint8_t y) { switch (y) { case 0: lcd_puts_P(PSTR("Exit menu")); break; case 1: lcd_puts_P(PSTR("Browse files")); break; case 2: lcd_puts_P(PSTR("Change device number")); break; case 3: if (rtc_state == RTC_NOT_FOUND) lcd_printf("Clock not found"); else lcd_printf("Set clock"); break; case 4: lcd_puts_P(PSTR("Select IEC/IEEE-488")); break; case 5: lcd_puts_P(PSTR("Adjust LCD contrast")); break; case 6: lcd_puts_P(PSTR("Adjust brightness")); break; default: break; } }
void sk_menu_1_2_3(){ unsigned char scelta; y_pos(1,0); lcd_printf("<< IMPOSTA TIMER"); scelta=scegli_presa(); //cursore su linea x }
void sk_menu_1_2_2(){ unsigned char scelta,stato; y_pos(1,0); lcd_printf("<< CAMBIA STATO "); scelta=scegli_presa(); stato=imposta_stato(scelta); presa_set_level(scelta,stato); }
static void RuntimeFault( int szText ) { lcd_printf("\014ERROR:\r\n%d\r\n", szText ); debug_printf( "ERROR: %d\r\n", szText ); // let watchdog take over CPU_Halt(); }
int example_applet_touch_handler(int xx, int yy) { lcd_fill(0, 0, 150, 40, 0xFF); lcd_printf(1,1, 20, "Touch %d,%d", xx, yy); // return non-zero to exit applet return xx > 200 && yy > 200; }
// STEP 1 void brew_delay_start(int init) { if (g_settings.delay_start_hours == 0) brew_next_step(); int remain = g_settings.delay_start_hours * 3600 - g_state.step_runtime; if (init) { lcd_printf(0, 3, 36, "Delayed start: 00:00:00 remaining"); return; } lcd_printf(15, 3, 8, "%.2d:%.2d:%.2d", remain / 3600, (remain % 3600) / 60, remain % 60); vTaskDelay(300); brew_next_step_if(g_state.step_runtime > g_settings.delay_start_hours * 3600); }
BOOL LPC22XX_SPI_Driver::nWrite16_nRead16( const SPI_CONFIGURATION& Configuration, UINT16* Write16, INT32 WriteCount, UINT16* Read16, INT32 ReadCount, INT32 ReadStartOffset ) { lcd_printf("\fSPI Peripheral does not support 16 bit transfer\r\n"); hal_printf("\fSPI Peripheral does not support 16 bit transfer\r\n"); HARD_BREAKPOINT(); return FALSE; }
void PXA271_USART_Driver::USART_ISR( void* param ) { // we lock since we are low priority and anyone might try to add a char in another ISR GLOBAL_LOCK(irq); UINT32 comPort = (UINT32)param; PXA271_USART& USART = PXA271::USART( comPort ); switch( USART.IIR & PXA271_USART::IIR__IID_MASK ) { case PXA271_USART::IIR__IID_RECEIVE_DATA: // If data in input FIFO // if the charger came in and turned off the serial port, bail now, as the source // will be going away if(c_RefFlagRx & g_PXA271_USART_Driver.m_RefFlags[comPort]) { if(USART.LSR & PXA271_USART::LSR__DR) { USART_AddCharToRxBuffer( comPort, (char)(USART.RBR & PXA271_USART::RBR__DATA_MASK8) ); Events_Set( SYSTEM_EVENT_FLAG_COM_IN ); } } break; case PXA271_USART::IIR__IID_TRANSMIT_FIFO: // If transmit FIFO can accept more characters // if the charger came in and turned off the serial port, bail now, as the source // will be going away if(c_RefFlagTx & g_PXA271_USART_Driver.m_RefFlags[comPort]) { char c; if(USART_RemoveCharFromTxBuffer( comPort, c )) { WriteCharToTxBuffer( comPort, c ); } else { // disable further Tx interrupts since we are level triggered TxBufferEmptyInterruptEnable( comPort, FALSE ); } Events_Set( SYSTEM_EVENT_FLAG_COM_OUT ); } break; #if defined(_DEBUG) case PXA271_USART::IIR__IID_RECEIVE_ERROR: // If there was an error receiving a character if(0 != (c_RefFlagRx & g_PXA271_USART_Driver.m_RefFlags[comPort])) { lcd_printf("\fLSR=%02x\r\n", USART.LSR & PXA271_USART::LSR__ERRORS); } break; #endif } }
int main() { WDTCTL = WDTPW | WDTHOLD; DCOCTL = CALDCO_16MHZ; BCSCTL1 = CALBC1_16MHZ; BCSCTL2 = DIVS_1; // SMCLK = DCO/2 (8MHz) //__delay_cycles(8000); // Short delay to let the LCD wake up -- turns out this isn't necessary // Chip select P2DIR |= BIT0; P2OUT |= BIT0; // Drive it high to disable LCD // Backlight P2DIR |= BIT5; P2OUT |= BIT5; // Turn on backlight // Pushbuttons P2DIR &= ~(BIT3 | BIT4); P2OUT |= BIT3 | BIT4; P2REN |= BIT3 | BIT4; P2IES |= BIT3 | BIT4; P2IFG &= ~(BIT3 | BIT4); P2IE |= BIT3 | BIT4; spi_init(); msp1202_init(); ste2007_contrast(8); lcd_printf("Hi there my\n"); lcd_printf("name is Eric.\n"); _EINT(); while(1) { if ( (~P2IN) & (BIT3|BIT4) ) { if (!(P2IN & BIT3)) { lcd_printf("S1 pressed\n"); P2OUT ^= BIT5; } if (!(P2IN & BIT4)) { lcd_printf("S2 pressed\n"); } } LPM4; } return 0; }
void vTaskDS1820DisplayTemps( void *pvParameters) { //char lcd_string[20]; static int count = 0; lcd_printf(1,1, 12, "TEMPERATURES"); for (;;) { xSemaphoreTake(xAppletRunningSemaphore, portMAX_DELAY); //take the semaphore so that the key handler wont //return to the menu system until its returned count++; //portENTER_CRITICAL(); lcd_fill(1,50, 200, 190, Black); lcd_printf(1, 5, 10, "HLT = %.2f", ds1820_get_temp(HLT)); lcd_printf(1, 6, 10, "Mash = %.2f", ds1820_get_temp(MASH)); lcd_printf(1, 7, 10, "Cabinet = %.2f", ds1820_get_temp(CABINET)); lcd_printf(1, 8, 10, "Ambient = %.2f", ds1820_get_temp(AMBIENT)); lcd_printf(1, 9, 10, "HLT_SSR = %.2f", ds1820_get_temp(HLT_SSR)); lcd_printf(1, 10, 10, "BOIL_SSR = %.2f", ds1820_get_temp(BOIL_SSR)); //printf("Display High water = %u\r\n",uxTaskGetStackHighWaterMark(NULL)); //portEXIT_CRITICAL(); xSemaphoreGive(xAppletRunningSemaphore); //give back the semaphore as its safe to return now. vTaskDelay(500); } }
void lcd_show_board_info(void) { ulong dram_size; int i; char temp[32]; lcd_printf("%s\n", U_BOOT_VERSION); lcd_printf("(C) 2015 Inter Act B.V.\n"); lcd_printf("[email protected]\n"); lcd_printf("%s CPU at %s MHz\n", ATMEL_CPU_NAME, strmhz(temp, get_cpu_clk_rate())); dram_size = 0; for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++) dram_size += gd->bd->bi_dram[i].size; lcd_printf(" %ld MB SDRAM\n", dram_size >> 20); }