]> rtime.felk.cvut.cz Git - pes-rpp/rpp-lwip.git/blobdiff - src/include/arch/sys_arch.h
lwip debug print functions
[pes-rpp/rpp-lwip.git] / src / include / arch / sys_arch.h
index d49f6c2f302ff6bc380c125817129fe00720b40e..a1da497a6757733842abca49233fa2745875617b 100644 (file)
@@ -53,6 +53,9 @@
 
 #define portQUEUE_OVERHEAD_BYTES 0
 
+/* 1 - semaphore/mutex is used to protect critical sections; 0 - interrupt disable is used to protect critical sections */
+#define SYS_ARCH_SEMPHR_PROTECT    1 & !NO_SYS
+
 typedef u8_t sys_prot_t;
 
 /* The values for an unallocated entities. */
@@ -87,39 +90,5 @@ typedef xSemaphoreHandle sys_mutex_t; /* *xQUEUE */
 
 #endif /* !NO_SYS */
 
-#ifdef SYS_TEST_PROT_SEM
-
-#define SYS_ARCH_DECL_PROTECT(lev) xSemaphoreHandle lev; lev = xSemaphoreCreateCounting(5,0)
-
-#define SYS_ARCH_PROTECT(lev) sys_sem_wait(&lev)
-
-#define SYS_ARCH_UNPROTECT(lev) sys_sem_signal(&lev)
-
-#endif
-
-/* when used SYS_ARCH_PROTECT from sys.h, then it might cause instability of the system */
-#ifdef SYS_ARCH_PROTECT
-
-#if SYS_LIGHTWEIGHT_PROT
-
-#define SYS_ARCH_DECL_PROTECT(lev)
-
-#define SYS_ARCH_PROTECT(lev) portENTER_CRITICAL() /* consider putting here taskENTER_CRITICAL() ... freeRTOS */
-
-#define SYS_ARCH_UNPROTECT(lev) portEXIT_CRITICAL() /* consider putting here taskEXIT_CRITICAL() ... freeRTOS */
-//sys_prot_t sys_arch_protect(void);
-//void sys_arch_unprotect(sys_prot_t pval);
-
-#else /* SYS_LIGHTWEIGHT_PROT */
-
-#define SYS_ARCH_DECL_PROTECT(lev)
-#define SYS_ARCH_PROTECT(lev)
-#define SYS_ARCH_UNPROTECT(lev)
-
-#endif /* SYS_LIGHTWEIGHT_PROT */
-
-#endif /* SYS_ARCH_PROTECT */
-
-
 #endif /* __ARCH_SYS_ARCH_H__ */