TextEncoding TextEncoding::PalmShiftJIS()
{
    return Fallback(
               TextEncoding(kTextEncodingDOSJapanese, kDOSJapanesePalmVariant,
                            kTextEncodingDefaultFormat),
               WindowsShiftJIS());
}
TextEncoding TextEncoding::PalmLatin1()
{
    return Fallback(
               TextEncoding(kTextEncodingWindowsLatin1, kWindowsLatin1PalmVariant,
                            kTextEncodingDefaultFormat),
               WindowsLatin1());
}
TextEncoding TextEncoding::WindowsLatin1()
{
    return Fallback(
               TextEncoding(kTextEncodingWindowsLatin1, kWindowsLatin1StandardVariant,
                            kTextEncodingDefaultFormat),
               ISOLatin1());
}
示例#4
0
	auto invoke_and_store_exception(callable&& Callable, fallback&& Fallback)
	{
		try
		{
			return Callable();
		}
		CATCH_AND_SAVE_EXCEPTION_TO(GlobalExceptionPtr())
		return Fallback();
	}
TextEncoding TextEncoding::WindowsShiftJIS()
{
    return Fallback(
               TextEncoding(kTextEncodingDOSJapanese, kDOSJapaneseStandardVariant,
                            kTextEncodingDefaultFormat),
               TextEncoding(kTextEncodingShiftJIS, kShiftJIS_DOSVariant,
                            kTextEncodingDefaultFormat),
               ShiftJIS());
}
示例#6
0
/*******************************************************************************
 * Function name: main
 * Description  : Main program function. Initializes the peripherals used in the
 *                demo and executes a loop that reads the ADC and updates the
 *                display once for each press of switch 1.
 * Arguments    : none
 * Return value : none
 *******************************************************************************/
void main(void) {
	/* One time initialize instructions */
	Setup();

	/* Endless loop*/
	while (1) {
		if (timers.timer_1mS) {
			timers.timer_1mS = 0;
			Callback_1ms();					//Operations to do every 1ms
			if (timers.timer_5mS) {
				timers.timer_5mS = 0;
				Callback_5ms();				// Operations to do every 5ms
				if (timers.timer_10mS) {
					timers.timer_10mS = 0;
					Callback_10ms();		// Operations to do every 10ms
					if (timers.timer_20mS) {
						timers.timer_20mS = 0;
						Callback_20ms();	// Operations to do every 20ms
					}
					if (timers.timer_50mS) {
						timers.timer_50mS = 0;
						Callback_50ms();
						if (timers.timer_100mS) {
							timers.timer_100mS = 0;
							Callback_100ms();
							if (timers.timer_500mS) {
								timers.timer_500mS = 0;
								Callback_500ms();
								if (timers.timer_1000mS) {
									timers.timer_1000mS = 0;
									Callback_1000ms();
								}
							}
						}

					}
				}
			}
		}
		WDT_Reset(&mainWDT);

//		//result = map(analogRead, 0, 4095, 1000, 2200);
//		Motor_Write_us(MOTOR_UPPER, desiredState.key.avg_motor_us + desiredState.key.motor_diff_us);
//		Motor_Write_us(MOTOR_BOTTOM, desiredState.key.avg_motor_us - desiredState.key.motor_diff_us);
//
//		//result = map(analogRead, 0, 4095, 60, 120);
//		Servo_Write_deg(1, desiredState.key.x_servo_deg + 18); //18° is the trim of the servo
//		Servo_Write_deg(2, desiredState.key.y_servo_deg);
	}
	Fallback();

} /* End function main() */
示例#7
0
	void Fallback()
	{
		User* user = ServerInstance->FindUUID(uid);
		Fallback(user);
	}
示例#8
0
void Sonar_Fallback() {
	sonarEchoCountStop();
	Fallback();	//TODO: remove this call when barometer will be used
}