mirror of
				https://github.com/esp8266/Arduino.git
				synced 2025-11-03 14:33:37 +03:00 
			
		
		
		
	Pass timeout to optimistic_yield, add cont_can_yield check
This commit is contained in:
		@@ -1,8 +1,8 @@
 | 
			
		||||
/* 
 | 
			
		||||
/*
 | 
			
		||||
 cont_util.s - continuations support for Xtensa call0 ABI
 | 
			
		||||
 Copyright (c) 2014 Ivan Grokhotkov. All rights reserved.
 | 
			
		||||
 This file is part of the esp8266 core for Arduino environment.
 | 
			
		||||
 
 | 
			
		||||
 | 
			
		||||
 This library is free software; you can redistribute it and/or
 | 
			
		||||
 modify it under the terms of the GNU Lesser General Public
 | 
			
		||||
 License as published by the Free Software Foundation; either
 | 
			
		||||
@@ -19,6 +19,9 @@
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "cont.h"
 | 
			
		||||
#include <stddef.h>
 | 
			
		||||
#include "ets_sys.h"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#define CONT_STACKGUARD 0xfeefeffe
 | 
			
		||||
 | 
			
		||||
@@ -34,3 +37,8 @@ int cont_check(cont_t* cont) {
 | 
			
		||||
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool cont_can_yield(cont_t* cont) {
 | 
			
		||||
    return !ETS_INTR_WITHINISR() &&
 | 
			
		||||
           cont->pc_ret != 0 && cont->pc_yield == 0;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user