mirror of
https://gitea.osmocom.org/sim-card/simtrace2.git
synced 2026-03-23 00:38:33 +03:00
req_ctx: Fix allocation (allocate 1 block, not all) and call _init()
This commit is contained in:
@@ -4,6 +4,8 @@
|
|||||||
*------------------------------------------------------------------------------*/
|
*------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "board.h"
|
#include "board.h"
|
||||||
|
#include "utils.h"
|
||||||
|
#include "req_ctx.h"
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
/*------------------------------------------------------------------------------
|
||||||
* Internal variables
|
* Internal variables
|
||||||
@@ -95,6 +97,8 @@ extern int main( void )
|
|||||||
/* Disable watchdog*/
|
/* Disable watchdog*/
|
||||||
WDT_Disable( WDT ) ;
|
WDT_Disable( WDT ) ;
|
||||||
|
|
||||||
|
req_ctx_init();
|
||||||
|
|
||||||
PIO_InitializeInterrupts(0);
|
PIO_InitializeInterrupts(0);
|
||||||
|
|
||||||
SIMtrace_USB_Initialize();
|
SIMtrace_USB_Initialize();
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ req_ctx_find_get(int large, uint32_t old_state, uint32_t new_state)
|
|||||||
if (req_ctx[i].state == old_state) {
|
if (req_ctx[i].state == old_state) {
|
||||||
toReturn = &req_ctx[i];
|
toReturn = &req_ctx[i];
|
||||||
toReturn->state = new_state;
|
toReturn->state = new_state;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
local_irq_restore(flags);
|
local_irq_restore(flags);
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ struct req_ctx {
|
|||||||
uint8_t *data;
|
uint8_t *data;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
extern void req_ctx_init(void);
|
||||||
extern struct req_ctx __ramfunc *req_ctx_find_get(int large, uint32_t old_state, uint32_t new_state);
|
extern struct req_ctx __ramfunc *req_ctx_find_get(int large, uint32_t old_state, uint32_t new_state);
|
||||||
extern struct req_ctx *req_ctx_find_busy(void);
|
extern struct req_ctx *req_ctx_find_busy(void);
|
||||||
extern void req_ctx_set_state(struct req_ctx *ctx, uint32_t new_state);
|
extern void req_ctx_set_state(struct req_ctx *ctx, uint32_t new_state);
|
||||||
|
|||||||
Reference in New Issue
Block a user