Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
d18ced9c
Commit
d18ced9c
authored
Jul 08, 2015
by
Daniel Campora
Browse files
cc3200: Use alternative HAL_Delay also when interrupts are disabled.
parent
7463442e
Changes
3
Hide whitespace changes
Inline
Side-by-side
cc3200/hal/cc3200_hal.c
View file @
d18ced9c
...
...
@@ -46,6 +46,7 @@
#include
"telnet.h"
#include
"pybuart.h"
#include
"utils.h"
#include
"irq.h"
#ifdef USE_FREERTOS
#include
"FreeRTOS.h"
...
...
@@ -108,8 +109,8 @@ uint32_t HAL_GetTick(void) {
}
void
HAL_Delay
(
uint32_t
delay
)
{
// only if we are not within interrupt context
if
((
HAL_NVIC_INT_CTRL_REG
&
HAL_VECTACTIVE_MASK
)
==
0
)
{
// only if we are not within interrupt context
and interrupts are enabled
if
((
HAL_NVIC_INT_CTRL_REG
&
HAL_VECTACTIVE_MASK
)
==
0
&&
query_irq
()
==
IRQ_STATE_ENABLED
)
{
#ifdef USE_FREERTOS
vTaskDelay
(
delay
/
portTICK_PERIOD_MS
);
#else
...
...
@@ -121,8 +122,10 @@ void HAL_Delay(uint32_t delay) {
}
#endif
}
else
{
for
(
int
ms
=
1
;
ms
<=
delay
;
ms
++
)
{
UtilsDelay
(
UTILS_DELAY_US_TO_COUNT
(
ms
*
1000
));
for
(
int
ms
=
0
;
ms
<
delay
;
ms
++
)
{
// 500 instead of 1000 us to compensate the overhead of the for loop
// and the function call
UtilsDelay
(
UTILS_DELAY_US_TO_COUNT
(
500
));
}
}
}
...
...
cc3200/misc/mpsystick.c
View file @
d18ced9c
...
...
@@ -28,7 +28,6 @@
#include
"py/mpconfig.h"
#include MICROPY_HAL_H
#include
"py/obj.h"
#include
"irq.h"
#include
"mpsystick.h"
#include
"systick.h"
#include
"inc/hw_types.h"
...
...
cc3200/telnet/telnet.c
View file @
d18ced9c
...
...
@@ -38,6 +38,7 @@
#include
"mpexception.h"
#include
"serverstask.h"
#include
"genhdr/mpversion.h"
#include
"irq.h"
/******************************************************************************
DEFINE PRIVATE CONSTANTS
...
...
@@ -492,8 +493,8 @@ static void telnet_parse_input (uint8_t *str, int16_t *len) {
static
bool
telnet_send_with_retries
(
int16_t
sd
,
const
void
*
pBuf
,
int16_t
len
)
{
int32_t
retries
=
0
;
//
abort sending if we happen to be within interrupt context
if
((
HAL_NVIC_INT_CTRL_REG
&
HAL_VECTACTIVE_MASK
)
==
0
)
{
//
only if we are not within interrupt context and interrupts are enabled
if
((
HAL_NVIC_INT_CTRL_REG
&
HAL_VECTACTIVE_MASK
)
==
0
&&
query_irq
()
==
IRQ_STATE_ENABLED
)
{
do
{
_i16
result
=
sl_Send
(
sd
,
pBuf
,
len
,
0
);
if
(
result
>
0
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment