/* Interrupt handler for AST periodic. 
Enable an AST asynchronous wake-up source. */
void ast_enable_wakeup(Ast *ast, ast_wakeup_source_t source)
/* Interrupt handler for AST periodic. 
Enable an AST asynchronous wake-up source. */
void ast_enable_wakeup(Ast *ast, ast_wakeup_source_t source)
{
	while (ast_is_busy(ast)) {
	}
	switch (source) {
	case AST_WAKEUP_ALARM:
		ast->AST_WER |= AST_WER_ALARM0_1;
		break;
	case AST_WAKEUP_PER:
		ast->AST_WER |= AST_WER_PER0_1;
		break;
	case AST_WAKEUP_OVF:
		ast->AST_WER |= AST_WER_OVF_1;
		break;
	default:
		break;
	}
	while (ast_is_busy(ast)) {
	}
}