-->
Page 1 of 2

SDK 1.1.0 problems - os_intr_lock and os_intr_unlock - fix

PostPosted: Sat Jun 06, 2015 3:49 pm
by cal
Moin,

on 2 occasions I saw people struggling with missing os_intr_lock and os_intr_unlock when migrating to
SDK 1.1.0. (May be interesting for @scargill, inspired by @tve)

In SDK 0.9.5 both were #defines to some ets functions which reside in rom:
Code: Select allinclude-sdk-0.9.5/osapi.h:#define os_intr_lock ets_intr_lock
include-sdk-0.9.5/osapi.h:#define os_intr_unlock ets_intr_unlock


Code: Select allld/eagle.rom.addr.v6.ld:PROVIDE ( ets_intr_lock = 0x40000f74 );
ld/eagle.rom.addr.v6.ld:PROVIDE ( ets_intr_unlock = 0x40000f80 );


So when code references os_intr_lock it really used ets_intr_lock.

In SDK 1.1.0 those defines where removed.

Add to that poor programming style using no prototypes that goes undetected and linker
tries to resolve a function called os_intr_lock which does not exist.

Solution:
Either add defines to your code or change code to use the ets_* functions directly.

And please encourage people to use prototypes!

Hope that helps,
Cal

Re: SDK 1.1.0 problems - os_intr_lock and os_intr_unlock - f

PostPosted: Sat Jun 13, 2015 12:15 pm
by 0x6e
Thanks Cal, I had this problem exactly.

Re: SDK 1.1.0 problems - os_intr_lock and os_intr_unlock - f

PostPosted: Thu Jul 09, 2015 7:02 am
by eriksl
Wat does this function actually do?

And indeed, the lack of prototypes is horrible.

Re: SDK 1.1.0 problems - os_intr_lock and os_intr_unlock - f

PostPosted: Thu Jul 09, 2015 7:10 am
by jcmvbkbc
eriksl wrote:Wat does this function actually do?

Disable and enable all maskable interrupts (including debug interrupt) in the CPU respectively.