#define IRQ_EINT13 60
#define IRQ_EINT14 61
#define IRQ_EINT15 62
#define IRQ_EINT16 63
//SysINT Number limit : 64
//#define IRQ_EINT17 63
//#define IRQ_EINT18 64
//#define IRQ_EINT19 63
//#define IRQ_EINT20 64
//#define IRQ_EINT21 65
//#define IRQ_EINT22 66
//#define IRQ_EINT23 67
#define IRQ_LAST IRQ_EINT16
疑惑:
1、本人曾尝试把 #define IRQ_EINT18 65
#define IRQ_LAST IRQ_EINT18
另外在初始化里也修改了对应的GPIO,并配成EINT18/GPG10引脚。依然无法检测到SD的插拔。是否漏了哪些地方没有改到位?此方法可行否?
2、另有一个方法,是否应该把EINT18 定义到63以内,初始化配成EINT18/GPG10引脚。然后去修改下面的函数(此方法还没有去试验,今天去试一下)
* OEMInterruptEnable
* OEMInterruptDisable
* OEMInterruptDone
* OEMInterruptHandle
请各位同行指教!
12 个解决方案
#1
方法2应该是可行的。而且现在很多是用动态分配中断号的,这样静态分配经常要面对这样的限制。
#2
第二种方法我今天已试一下,已经OK了,楼上的兄弟,动态分配和静态分配如何应用,能否说详细的,或者提供点资料,
第一种方法为什么不行啊???有没有哪些大侠解释一下
现在又有一个问题,2450有两个SD控制器,两个DRIVER,现在只能正常使用一个SD卡.即当有一个能读写时,另一个卡的插拔能检测到,但无法显示,无法读写.原因何在?
第一种方法为什么不行啊???有没有哪些大侠解释一下
现在又有一个问题,2450有两个SD控制器,两个DRIVER,现在只能正常使用一个SD卡.即当有一个能读写时,另一个卡的插拔能检测到,但无法显示,无法读写.原因何在?
#3
CE5提供了动态分配中断的方式,和CE4.2很大的不同。只要将中断号和中断线程按规定的结构体格式放在一起就行。和一般的静态分配,再初始化再OEMInterruptxxx之类的有很大的差别。不过说实话,看到这样用的很少。
#define IRQ_EINT18 65
#define IRQ_LAST IRQ_EINT18
那结果IRL_EINT18还是 65, IRT_LAST也同样是65。超过64了。
两个SD驱动器,能检测到说明驱动是好的。不过在WINCE中显示及读写,是由文件系统决定的。需要在注册表中增加相应的项。
#define IRQ_EINT18 65
#define IRQ_LAST IRQ_EINT18
那结果IRL_EINT18还是 65, IRT_LAST也同样是65。超过64了。
两个SD驱动器,能检测到说明驱动是好的。不过在WINCE中显示及读写,是由文件系统决定的。需要在注册表中增加相应的项。
#4
光改这个sysINT Numbe 还不行,需要修改platform/common下的文件,具体的发消息给你了
#5
可不可以超过64?通过改变映射数组的大小?我今天试了一下,没有成功.代码注释里写的是WINCE只支持 64 个IRQ 。
现在还有一问,如何支持双卡?两个卡同时插入时,先插入的卡能识别出来,显示STORAGE CARD。后面插入的不能显示,但线程能侦测到卡。
注册表里应该如何改动?SDBUS需要改吗??
#6
谢谢你的回复,
我看了中断转换的几个FUN, 能改的只是宏定义 SYSINTR_MAXIMUM 和 OAL_INTR_IRQ_MAXIMUM 的大小
SYSINTR_MAXIMUM 本来是64+8,我没有做修改,
OAL_INTR_IRQ_MAXIMUM 原来是64,我改成66,
还需要改到别的地方吗?
VOID OALIntrStaticTranslate(UINT32 sysIntr, UINT32 irq)
{
OALMSG(OAL_FUNC&&OAL_INTR, (
L"+OALIntrStaticTranslate(%d, %d)\r\n", sysIntr, irq
));
if (irq < OAL_INTR_IRQ_MAXIMUM && sysIntr < SYSINTR_MAXIMUM) {
g_oalSysIntr2Irq[sysIntr] = irq;
g_oalIrq2SysIntr[irq] = sysIntr;
}
OALMSG(OAL_FUNC&&OAL_INTR, (L"-OALIntrStaticTranslate\r\n"));
}
BOOL OALIntrTranslateSysIntr(
UINT32 sysIntr, UINT32 *pCount, const UINT32 **ppIrqs
) {
BOOL rc;
OALMSG(OAL_INTR&&OAL_VERBOSE, (L"+OALTranslateSysIntr(%d)\r\n", sysIntr));
// Valid SYSINTR?
if (sysIntr >= SYSINTR_MAXIMUM) {
rc = FALSE;
goto cleanUp;
}
*pCount = 1;
*ppIrqs = &g_oalSysIntr2Irq[sysIntr];
rc = TRUE;
cleanUp:
OALMSG(OAL_INTR&&OAL_VERBOSE, (L"-OALTranslateSysIntr(rc = %d)\r\n", rc));
return rc;
}
//------------------------------------------------------------------------------
//
// Function: OALIntrTranslateIrq
//
// This function maps a IRQ to its corresponding SYSINTR.
//
UINT32 OALIntrTranslateIrq(UINT32 irq)
{
UINT32 sysIntr = SYSINTR_UNDEFINED;
OALMSG(OAL_FUNC&&OAL_VERBOSE, (L"+OALIntrTranslateIrq(%d)\r\n", irq));
if (irq >= OAL_INTR_IRQ_MAXIMUM) goto cleanUp;
sysIntr = g_oalIrq2SysIntr[irq];
cleanUp:
OALMSG(OAL_FUNC&&OAL_VERBOSE, (
L"-OEMTranslateIrq(sysIntr = %d)\r\n", sysIntr
));
return sysIntr;
}
//------------------------------------------------------------------------------
//
// Function: OALIntrRequestSysIntr
//
// This function allocate new SYSINTR for given IRQ and it there isn't
// static mapping for this IRQ it will create it.
//
UINT32 OALIntrRequestSysIntr(UINT32 count, const UINT32 *pIrqs, UINT32 flags)
{
UINT32 irq, sysIntr;
OALMSG(OAL_INTR&&OAL_FUNC, (
L"+OALIntrRequestSysIntr(%d, 0x%08x, 0x%08x)\r\n", count, pIrqs, flags
));
// Valid IRQ?
if (count != 1 || pIrqs[0] >= OAL_INTR_IRQ_MAXIMUM) {
sysIntr = SYSINTR_UNDEFINED;
goto cleanUp;
}
irq = pIrqs[0];
// If there is mapping for given irq check for special cases
if (g_oalIrq2SysIntr[irq] != SYSINTR_UNDEFINED) {
// If static mapping is requested we fail
if ((flags & OAL_INTR_STATIC) != 0) {
OALMSG(OAL_ERROR, (L"ERROR: OALIntrRequestSysIntr: "
L"Static mapping for IRQ %d already assigned\r\n", irq
));
sysIntr = SYSINTR_UNDEFINED;
goto cleanUp;
}
// If we should translate, return existing SYSINTR
if ((flags & OAL_INTR_TRANSLATE) != 0) {
sysIntr = g_oalIrq2SysIntr[irq];
goto cleanUp;
}
}
// Find next available SYSINTR value...
for (sysIntr = SYSINTR_FIRMWARE; sysIntr < SYSINTR_MAXIMUM; sysIntr++) {
if (g_oalSysIntr2Irq[sysIntr] == OAL_INTR_IRQ_UNDEFINED) break;
}
// Any available SYSINTRs left?
if (sysIntr >= SYSINTR_MAXIMUM) {
OALMSG(OAL_ERROR, (L"ERROR: OALIntrRequestSysIntr: "
L"No avaiable SYSINTR found\r\n"
));
sysIntr = SYSINTR_UNDEFINED;
goto cleanUp;
}
// Make SYSINTR -> IRQ association.
g_oalSysIntr2Irq[sysIntr] = irq;
// Make IRQ -> SYSINTR association if required
if ((flags & OAL_INTR_DYNAMIC) != 0) goto cleanUp;
if (
g_oalIrq2SysIntr[irq] == SYSINTR_UNDEFINED ||
(flags & OAL_INTR_FORCE_STATIC) != 0
) {
g_oalIrq2SysIntr[irq] = sysIntr;
}
cleanUp:
OALMSG(OAL_INTR&&OAL_FUNC, (
L"-OALIntrRequestSysIntr(sysIntr = %d)\r\n", sysIntr
));
return sysIntr;
}
//------------------------------------------------------------------------------
//
// Function: OALIntrReleaseSysIntr
//
// This function release given SYSINTR and remove static mapping if exists.
//
BOOL OALIntrReleaseSysIntr(UINT32 sysIntr)
{
BOOL rc = FALSE;
UINT32 irq;
OALMSG(OAL_INTR&&OAL_FUNC, (L"+OALIntrReleaseSysIntr(%d)\r\n", sysIntr));
// Is the SYSINTR already released?
if (g_oalSysIntr2Irq[sysIntr] == OAL_INTR_IRQ_UNDEFINED) goto cleanUp;
// Remove the SYSINTR -> IRQ mapping
irq = g_oalSysIntr2Irq[sysIntr];
g_oalSysIntr2Irq[sysIntr] = OAL_INTR_IRQ_UNDEFINED;
// If we're releasing the SYSINTR directly mapped in the IRQ mapping,
// remove the IRQ mapping also
if (g_oalIrq2SysIntr[irq] == sysIntr) {
g_oalIrq2SysIntr[irq] = SYSINTR_UNDEFINED;
}
cleanUp:
OALMSG(OAL_INTR&&OAL_FUNC, (L"-OALIntrReleaseSysIntr(rc = %d)\r\n", rc));
return rc;
}
#7
怎么就没有人讨论了呢???
还是结贴吧.
还是结贴吧.
#8
因为没有常顶^_^
#9
不错,的东西,学习
#10
你好,周工
请问板子做得如何了?
我们在寻找三星S3C2450的板子,如果有兴趣,请联系我:
QQ 403635710
MSN catharine123@163.com
Skype cathylaw1
电话:0755-23991143 ext:606
请问板子做得如何了?
我们在寻找三星S3C2450的板子,如果有兴趣,请联系我:
QQ 403635710
MSN catharine123@163.com
Skype cathylaw1
电话:0755-23991143 ext:606
#11
mark
#12
另有一个方法,是否应该把EINT18 定义到63以内,初始化配成EINT18/GPG10引脚。然后去修改下面的函数(此方法还没有去试验,今天去试一下)
* OEMInterruptEnable
* OEMInterruptDisable
* OEMInterruptDone
* OEMInterruptHandle
驱动里使用外部中断的时候需要修改在这些函数里面添加使能或者屏蔽中断的相应代码么?我一直不明白·
* OEMInterruptEnable
* OEMInterruptDisable
* OEMInterruptDone
* OEMInterruptHandle
驱动里使用外部中断的时候需要修改在这些函数里面添加使能或者屏蔽中断的相应代码么?我一直不明白·
#1
方法2应该是可行的。而且现在很多是用动态分配中断号的,这样静态分配经常要面对这样的限制。
#2
第二种方法我今天已试一下,已经OK了,楼上的兄弟,动态分配和静态分配如何应用,能否说详细的,或者提供点资料,
第一种方法为什么不行啊???有没有哪些大侠解释一下
现在又有一个问题,2450有两个SD控制器,两个DRIVER,现在只能正常使用一个SD卡.即当有一个能读写时,另一个卡的插拔能检测到,但无法显示,无法读写.原因何在?
第一种方法为什么不行啊???有没有哪些大侠解释一下
现在又有一个问题,2450有两个SD控制器,两个DRIVER,现在只能正常使用一个SD卡.即当有一个能读写时,另一个卡的插拔能检测到,但无法显示,无法读写.原因何在?
#3
CE5提供了动态分配中断的方式,和CE4.2很大的不同。只要将中断号和中断线程按规定的结构体格式放在一起就行。和一般的静态分配,再初始化再OEMInterruptxxx之类的有很大的差别。不过说实话,看到这样用的很少。
#define IRQ_EINT18 65
#define IRQ_LAST IRQ_EINT18
那结果IRL_EINT18还是 65, IRT_LAST也同样是65。超过64了。
两个SD驱动器,能检测到说明驱动是好的。不过在WINCE中显示及读写,是由文件系统决定的。需要在注册表中增加相应的项。
#define IRQ_EINT18 65
#define IRQ_LAST IRQ_EINT18
那结果IRL_EINT18还是 65, IRT_LAST也同样是65。超过64了。
两个SD驱动器,能检测到说明驱动是好的。不过在WINCE中显示及读写,是由文件系统决定的。需要在注册表中增加相应的项。
#4
光改这个sysINT Numbe 还不行,需要修改platform/common下的文件,具体的发消息给你了
#5
可不可以超过64?通过改变映射数组的大小?我今天试了一下,没有成功.代码注释里写的是WINCE只支持 64 个IRQ 。
现在还有一问,如何支持双卡?两个卡同时插入时,先插入的卡能识别出来,显示STORAGE CARD。后面插入的不能显示,但线程能侦测到卡。
注册表里应该如何改动?SDBUS需要改吗??
#6
谢谢你的回复,
我看了中断转换的几个FUN, 能改的只是宏定义 SYSINTR_MAXIMUM 和 OAL_INTR_IRQ_MAXIMUM 的大小
SYSINTR_MAXIMUM 本来是64+8,我没有做修改,
OAL_INTR_IRQ_MAXIMUM 原来是64,我改成66,
还需要改到别的地方吗?
VOID OALIntrStaticTranslate(UINT32 sysIntr, UINT32 irq)
{
OALMSG(OAL_FUNC&&OAL_INTR, (
L"+OALIntrStaticTranslate(%d, %d)\r\n", sysIntr, irq
));
if (irq < OAL_INTR_IRQ_MAXIMUM && sysIntr < SYSINTR_MAXIMUM) {
g_oalSysIntr2Irq[sysIntr] = irq;
g_oalIrq2SysIntr[irq] = sysIntr;
}
OALMSG(OAL_FUNC&&OAL_INTR, (L"-OALIntrStaticTranslate\r\n"));
}
BOOL OALIntrTranslateSysIntr(
UINT32 sysIntr, UINT32 *pCount, const UINT32 **ppIrqs
) {
BOOL rc;
OALMSG(OAL_INTR&&OAL_VERBOSE, (L"+OALTranslateSysIntr(%d)\r\n", sysIntr));
// Valid SYSINTR?
if (sysIntr >= SYSINTR_MAXIMUM) {
rc = FALSE;
goto cleanUp;
}
*pCount = 1;
*ppIrqs = &g_oalSysIntr2Irq[sysIntr];
rc = TRUE;
cleanUp:
OALMSG(OAL_INTR&&OAL_VERBOSE, (L"-OALTranslateSysIntr(rc = %d)\r\n", rc));
return rc;
}
//------------------------------------------------------------------------------
//
// Function: OALIntrTranslateIrq
//
// This function maps a IRQ to its corresponding SYSINTR.
//
UINT32 OALIntrTranslateIrq(UINT32 irq)
{
UINT32 sysIntr = SYSINTR_UNDEFINED;
OALMSG(OAL_FUNC&&OAL_VERBOSE, (L"+OALIntrTranslateIrq(%d)\r\n", irq));
if (irq >= OAL_INTR_IRQ_MAXIMUM) goto cleanUp;
sysIntr = g_oalIrq2SysIntr[irq];
cleanUp:
OALMSG(OAL_FUNC&&OAL_VERBOSE, (
L"-OEMTranslateIrq(sysIntr = %d)\r\n", sysIntr
));
return sysIntr;
}
//------------------------------------------------------------------------------
//
// Function: OALIntrRequestSysIntr
//
// This function allocate new SYSINTR for given IRQ and it there isn't
// static mapping for this IRQ it will create it.
//
UINT32 OALIntrRequestSysIntr(UINT32 count, const UINT32 *pIrqs, UINT32 flags)
{
UINT32 irq, sysIntr;
OALMSG(OAL_INTR&&OAL_FUNC, (
L"+OALIntrRequestSysIntr(%d, 0x%08x, 0x%08x)\r\n", count, pIrqs, flags
));
// Valid IRQ?
if (count != 1 || pIrqs[0] >= OAL_INTR_IRQ_MAXIMUM) {
sysIntr = SYSINTR_UNDEFINED;
goto cleanUp;
}
irq = pIrqs[0];
// If there is mapping for given irq check for special cases
if (g_oalIrq2SysIntr[irq] != SYSINTR_UNDEFINED) {
// If static mapping is requested we fail
if ((flags & OAL_INTR_STATIC) != 0) {
OALMSG(OAL_ERROR, (L"ERROR: OALIntrRequestSysIntr: "
L"Static mapping for IRQ %d already assigned\r\n", irq
));
sysIntr = SYSINTR_UNDEFINED;
goto cleanUp;
}
// If we should translate, return existing SYSINTR
if ((flags & OAL_INTR_TRANSLATE) != 0) {
sysIntr = g_oalIrq2SysIntr[irq];
goto cleanUp;
}
}
// Find next available SYSINTR value...
for (sysIntr = SYSINTR_FIRMWARE; sysIntr < SYSINTR_MAXIMUM; sysIntr++) {
if (g_oalSysIntr2Irq[sysIntr] == OAL_INTR_IRQ_UNDEFINED) break;
}
// Any available SYSINTRs left?
if (sysIntr >= SYSINTR_MAXIMUM) {
OALMSG(OAL_ERROR, (L"ERROR: OALIntrRequestSysIntr: "
L"No avaiable SYSINTR found\r\n"
));
sysIntr = SYSINTR_UNDEFINED;
goto cleanUp;
}
// Make SYSINTR -> IRQ association.
g_oalSysIntr2Irq[sysIntr] = irq;
// Make IRQ -> SYSINTR association if required
if ((flags & OAL_INTR_DYNAMIC) != 0) goto cleanUp;
if (
g_oalIrq2SysIntr[irq] == SYSINTR_UNDEFINED ||
(flags & OAL_INTR_FORCE_STATIC) != 0
) {
g_oalIrq2SysIntr[irq] = sysIntr;
}
cleanUp:
OALMSG(OAL_INTR&&OAL_FUNC, (
L"-OALIntrRequestSysIntr(sysIntr = %d)\r\n", sysIntr
));
return sysIntr;
}
//------------------------------------------------------------------------------
//
// Function: OALIntrReleaseSysIntr
//
// This function release given SYSINTR and remove static mapping if exists.
//
BOOL OALIntrReleaseSysIntr(UINT32 sysIntr)
{
BOOL rc = FALSE;
UINT32 irq;
OALMSG(OAL_INTR&&OAL_FUNC, (L"+OALIntrReleaseSysIntr(%d)\r\n", sysIntr));
// Is the SYSINTR already released?
if (g_oalSysIntr2Irq[sysIntr] == OAL_INTR_IRQ_UNDEFINED) goto cleanUp;
// Remove the SYSINTR -> IRQ mapping
irq = g_oalSysIntr2Irq[sysIntr];
g_oalSysIntr2Irq[sysIntr] = OAL_INTR_IRQ_UNDEFINED;
// If we're releasing the SYSINTR directly mapped in the IRQ mapping,
// remove the IRQ mapping also
if (g_oalIrq2SysIntr[irq] == sysIntr) {
g_oalIrq2SysIntr[irq] = SYSINTR_UNDEFINED;
}
cleanUp:
OALMSG(OAL_INTR&&OAL_FUNC, (L"-OALIntrReleaseSysIntr(rc = %d)\r\n", rc));
return rc;
}
#7
怎么就没有人讨论了呢???
还是结贴吧.
还是结贴吧.
#8
因为没有常顶^_^
#9
不错,的东西,学习
#10
你好,周工
请问板子做得如何了?
我们在寻找三星S3C2450的板子,如果有兴趣,请联系我:
QQ 403635710
MSN catharine123@163.com
Skype cathylaw1
电话:0755-23991143 ext:606
请问板子做得如何了?
我们在寻找三星S3C2450的板子,如果有兴趣,请联系我:
QQ 403635710
MSN catharine123@163.com
Skype cathylaw1
电话:0755-23991143 ext:606
#11
mark
#12
另有一个方法,是否应该把EINT18 定义到63以内,初始化配成EINT18/GPG10引脚。然后去修改下面的函数(此方法还没有去试验,今天去试一下)
* OEMInterruptEnable
* OEMInterruptDisable
* OEMInterruptDone
* OEMInterruptHandle
驱动里使用外部中断的时候需要修改在这些函数里面添加使能或者屏蔽中断的相应代码么?我一直不明白·
* OEMInterruptEnable
* OEMInterruptDisable
* OEMInterruptDone
* OEMInterruptHandle
驱动里使用外部中断的时候需要修改在这些函数里面添加使能或者屏蔽中断的相应代码么?我一直不明白·