Exemplo n.º 1
0
void rtclock_disp_xy(int x, int y, int dots, int display_seconds)
{
	unsigned int m = the_clock / 60;
	
	unsigned int minutes = m % 60;
	
	unsigned int h = m / 60;
	
	unsigned int hours = h % 24;
	
	char buf[3];
	
	vdisp_i2s(buf, 2, 10, 1, hours);
	vdisp_prints_xy(x, y, VDISP_FONT_6x8, 0, buf);

	vdisp_set_pixel(x + 12, y + 0, 0, 0, 4);
	vdisp_set_pixel(x + 12, y + 1, 0, dots, 4);
	vdisp_set_pixel(x + 12, y + 2, 0, 0, 4);
	vdisp_set_pixel(x + 12, y + 3, 0, 0, 4);
	vdisp_set_pixel(x + 12, y + 4, 0, 0, 4);
	vdisp_set_pixel(x + 12, y + 5, 0, dots, 4);
	vdisp_set_pixel(x + 12, y + 6, 0, 0, 4);
	vdisp_set_pixel(x + 12, y + 7, 0, 0, 4);
	
	vdisp_i2s(buf, 2, 10, 1, minutes);
	vdisp_prints_xy(x + 16, y, VDISP_FONT_6x8, 0, buf);
	
	if (display_seconds != 0)
	{
		vdisp_set_pixel(x + 28, y + 0, 0, 0, 4);
		vdisp_set_pixel(x + 28, y + 1, 0, dots, 4);
		vdisp_set_pixel(x + 28, y + 2, 0, 0, 4);
		vdisp_set_pixel(x + 28, y + 3, 0, 0, 4);
		vdisp_set_pixel(x + 28, y + 4, 0, 0, 4);
		vdisp_set_pixel(x + 28, y + 5, 0, dots, 4);
		vdisp_set_pixel(x + 28, y + 6, 0, 0, 4);
		vdisp_set_pixel(x + 28, y + 7, 0, 0, 4);
	
		unsigned int seconds = the_clock % 60;
		
		vdisp_i2s(buf, 2, 10, 1, seconds);
		vdisp_prints_xy(x + 32, y, VDISP_FONT_6x8, 0, buf);
	}
}
Exemplo n.º 2
0
static void show_ccs_state(void)
{
	char buf[8];
	
	memcpy(buf, ccs_current_servername(), 6);
	buf[6] = 32;
	buf[7] = 0;
	vdisp_prints_xy( 103, 33, VDISP_FONT_4x6,
	 ccs_is_connected(), buf );
	
}		
Exemplo n.º 3
0
static void show_dcs_state(void)
{
	char buf[10];
	dcs_get_current_reflector_name(buf);
	buf[8] = 32;
	buf[9] = 0;
	vdisp_prints_xy( 95, 27, VDISP_FONT_4x6, 
		dcs_is_connected(), buf );

		if (dcs_changed() && ((repeater_mode != 0) || (hotspot_mode != 0)))
		{
			send_dcs_state();
		}
}		
Exemplo n.º 4
0
static void vServiceTask( void *pvParameters )
{
	
	int last_backlight = -1;
	int last_contrast = -1;
	char last_repeater_mode = 0;
	char last_parrot_mode = 0;
	char dcs_boot_timer = 8;
	// bool update = true;
	bool last_rmu_enabled = false;

	for (;;)
	{	
		
		vTaskDelay(500); 
		
		// gpio_toggle_pin(AVR32_PIN_PB28);
		//gpio_toggle_pin(AVR32_PIN_PB18);
			
		// x_counter ++;
			
		
		// rtclock_disp_xy(84, 0, x_counter & 0x02, 1);
		rtclock_disp_xy(84, 0, 2, 1);
			
			
			
		vdisp_i2s( tmp_buf, 5, 10, 0, voltage);
		tmp_buf[3] = tmp_buf[2];
		tmp_buf[2] = '.';
		tmp_buf[4] = 'V';
		tmp_buf[5] = 0;
			
			
		vdisp_prints_xy( 55, 0, VDISP_FONT_4x6, 0, tmp_buf );
			
		// vdisp_i2s( tmp_buf, 5, 10, 0, serial_rx_error );
		// vd_prints_xy(VDISP_DEBUG_LAYER, 108, 28, VDISP_FONT_4x6, 0, tmp_buf );
		vdisp_i2s( tmp_buf, 5, 10, 0, serial_rx_ok );
		vd_prints_xy(VDISP_DEBUG_LAYER, 108, 34, VDISP_FONT_4x6, 0, tmp_buf );	
		// vdisp_i2s( tmp_buf, 5, 10, 0, serial_timeout_error );
		vdisp_i2s( tmp_buf, 5, 10, 0, dstar_pos_not_correct );
		vd_prints_xy(VDISP_DEBUG_LAYER, 108, 40, VDISP_FONT_4x6, 0, tmp_buf );
		vdisp_i2s( tmp_buf, 5, 10, 0, serial_putc_q_full );
		vd_prints_xy(VDISP_DEBUG_LAYER, 108, 46, VDISP_FONT_4x6, 0, tmp_buf );
		vdisp_i2s( tmp_buf, 5, 10, 0, initialHeapSize );
		vd_prints_xy(VDISP_DEBUG_LAYER, 108, 52, VDISP_FONT_4x6, 0, tmp_buf );
		vdisp_i2s( tmp_buf, 5, 10, 0, xPortGetFreeHeapSize() );
		vd_prints_xy(VDISP_DEBUG_LAYER, 108, 58, VDISP_FONT_4x6, 0, tmp_buf );
		
		
		int v = 0;
			
		switch (eth_autoneg_state)
		{
			case 0:
			if (SETTING_BOOL(B_ONLY_TEN_MBIT))
			{
				AVR32_MACB.man = 0x50920061; // write register 0x04, advertise only 10MBit/s for autoneg
			}
			eth_autoneg_state = 1;
			break;
			
			case 1:
			AVR32_MACB.man = 0x50821200; // write register 0x00, power on, autoneg, restart autoneg
			eth_autoneg_state = 2;
			break;
			
			case 2:
			AVR32_MACB.man = 0x60C20000; // read register 0x10
			eth_autoneg_state = 3;
			break;
			
			case 3:
			v = AVR32_MACB.MAN.data; // read data from previously read register 0x10
			AVR32_MACB.man = 0x60C20000; // read register 0x10
			break;
		}
		
		dvset();
		nodeinfo_print();
				
		if (last_rmu_enabled != rmu_enabled)
		{
			rmuset_print();
			last_rmu_enabled = rmu_enabled;
		}

			
		const char * net_status = "     ";
			
		dhcp_set_link_state( v & 1 );
			
		if (v & 1)  // Ethernet link is active
		{
			v = ((v >> 1) & 0x03) ^ 0x01;
				
			switch (v)
			{
				case 0:
					net_status = " 10HD";
					break;
				case 1:
					net_status = "100HD";
					break;
				case 2:
					net_status = " 10FD";
					break;
				case 3:
					net_status = "100FD";
					break;
			}
				
			AVR32_MACB.ncfgr = 0x00000800 | v;  // SPD, FD, CLK = MCK / 32 -> 1.875 MHz
				
			vdisp_prints_xy( 28, 0, VDISP_FONT_4x6, 
				(dhcp_is_ready() != 0) ? 0 : 1, net_status );
		}
		else
		{