author
int64 658
755k
| date
stringlengths 19
19
| timezone
int64 -46,800
43.2k
| hash
stringlengths 40
40
| message
stringlengths 5
490
| mods
list | language
stringclasses 20
values | license
stringclasses 3
values | repo
stringlengths 5
68
| original_message
stringlengths 12
491
|
---|---|---|---|---|---|---|---|---|---|
491,595 |
18.04.2018 11:20:13
| -7,200 |
825ff97b2b5b7704bad2df9afbf00a14ba6aa5c2
|
rephrase variables name.
|
[
{
"change_type": "MODIFY",
"old_path": "drivers/common/opentimers.c",
"new_path": "drivers/common/opentimers.c",
"diff": "@@ -108,17 +108,17 @@ void opentimers_scheduleIn(opentimers_id_t id,\n// 2. updat the timer content\nswitch (uint_type){\ncase TIME_MS:\n- opentimers_vars.timersBuf[id].totalTimerPeriod = duration*PORT_TICS_PER_MS;\n+ opentimers_vars.timersBuf[id].duration = duration*PORT_TICS_PER_MS;\nopentimers_vars.timersBuf[id].wraps_remaining = (uint32_t)(duration*PORT_TICS_PER_MS)/MAX_TICKS_IN_SINGLE_CLOCK;\nbreak;\ncase TIME_TICS:\n- opentimers_vars.timersBuf[id].totalTimerPeriod = duration;\n+ opentimers_vars.timersBuf[id].duration = duration;\nopentimers_vars.timersBuf[id].wraps_remaining = (uint32_t)(duration)/MAX_TICKS_IN_SINGLE_CLOCK;\nbreak;\n}\nif (opentimers_vars.timersBuf[id].wraps_remaining==0){\n- opentimers_vars.timersBuf[id].currentCompareValue = opentimers_vars.timersBuf[id].totalTimerPeriod+sctimer_readCounter();\n+ opentimers_vars.timersBuf[id].currentCompareValue = opentimers_vars.timersBuf[id].duration+sctimer_readCounter();\n} else {\nopentimers_vars.timersBuf[id].currentCompareValue = MAX_TICKS_IN_SINGLE_CLOCK+sctimer_readCounter();\n}\n@@ -128,17 +128,17 @@ void opentimers_scheduleIn(opentimers_id_t id,\n// 3. find the next timer to fire\n- // only execute update the currenttimeout if I am not inside of ISR or the ISR itself will do this.\n+ // only execute update the currentCompareValue if I am not inside of ISR or the ISR itself will do this.\nif (opentimers_vars.insideISR==FALSE){\ni = 0;\nwhile (opentimers_vars.timersBuf[i].isrunning==FALSE){\ni++;\n}\n- timerGap = opentimers_vars.timersBuf[i].currentCompareValue-opentimers_vars.lastTimeout;\n+ timerGap = opentimers_vars.timersBuf[i].currentCompareValue-opentimers_vars.lastCompareValue;\nidToSchedule = i;\nfor (i=idToSchedule+1;i<MAX_NUM_TIMERS;i++){\nif (opentimers_vars.timersBuf[i].isrunning){\n- tempTimerGap = opentimers_vars.timersBuf[i].currentCompareValue-opentimers_vars.lastTimeout;\n+ tempTimerGap = opentimers_vars.timersBuf[i].currentCompareValue-opentimers_vars.lastCompareValue;\nif (tempTimerGap < timerGap){\n// timer \"i\" is more close to lastCompare value\ntimerGap = tempTimerGap;\n@@ -148,8 +148,8 @@ void opentimers_scheduleIn(opentimers_id_t id,\n}\n// if I got here, assign the next to be fired timer to given timer\n- opentimers_vars.currentTimeout = opentimers_vars.timersBuf[idToSchedule].currentCompareValue;\n- sctimer_setCompare(opentimers_vars.currentTimeout);\n+ opentimers_vars.currentCompareValue = opentimers_vars.timersBuf[idToSchedule].currentCompareValue;\n+ sctimer_setCompare(opentimers_vars.currentCompareValue);\n}\nopentimers_vars.running = TRUE;\n}\n@@ -176,6 +176,7 @@ void opentimers_scheduleAbsolute(opentimers_id_t id,\nuint8_t idToSchedule;\nPORT_TIMER_WIDTH timerGap;\nPORT_TIMER_WIDTH tempTimerGap;\n+\n// 1. make sure the timer exist\nfor (i=0;i<MAX_NUM_TIMERS;i++){\nif (opentimers_vars.timersBuf[i].isUsed && i == id){\n@@ -193,17 +194,17 @@ void opentimers_scheduleAbsolute(opentimers_id_t id,\n// 2. updat the timer content\nswitch (uint_type){\ncase TIME_MS:\n- opentimers_vars.timersBuf[id].totalTimerPeriod = duration*PORT_TICS_PER_MS;\n+ opentimers_vars.timersBuf[id].duration = duration*PORT_TICS_PER_MS;\nopentimers_vars.timersBuf[id].wraps_remaining = (uint32_t)(duration*PORT_TICS_PER_MS)/MAX_TICKS_IN_SINGLE_CLOCK;;\nbreak;\ncase TIME_TICS:\n- opentimers_vars.timersBuf[id].totalTimerPeriod = duration;\n+ opentimers_vars.timersBuf[id].duration = duration;\nopentimers_vars.timersBuf[id].wraps_remaining = (uint32_t)duration/MAX_TICKS_IN_SINGLE_CLOCK;\nbreak;\n}\nif (opentimers_vars.timersBuf[id].wraps_remaining==0){\n- opentimers_vars.timersBuf[id].currentCompareValue = opentimers_vars.timersBuf[id].totalTimerPeriod+reference;\n+ opentimers_vars.timersBuf[id].currentCompareValue = opentimers_vars.timersBuf[id].duration+reference;\n} else {\nopentimers_vars.timersBuf[id].currentCompareValue = MAX_TICKS_IN_SINGLE_CLOCK+reference;\n}\n@@ -213,17 +214,17 @@ void opentimers_scheduleAbsolute(opentimers_id_t id,\n// 3. find the next timer to fire\n- // only execute update the currenttimeout if I am not inside of ISR or the ISR itself will do this.\n+ // only execute update the currentCompareValue if I am not inside of ISR or the ISR itself will do this.\nif (opentimers_vars.insideISR==FALSE){\ni = 0;\nwhile (opentimers_vars.timersBuf[i].isrunning==FALSE){\ni++;\n}\n- timerGap = opentimers_vars.timersBuf[i].currentCompareValue-opentimers_vars.lastTimeout;\n+ timerGap = opentimers_vars.timersBuf[i].currentCompareValue-opentimers_vars.lastCompareValue;\nidToSchedule = i;\nfor (i=idToSchedule+1;i<MAX_NUM_TIMERS;i++){\nif (opentimers_vars.timersBuf[i].isrunning){\n- tempTimerGap = opentimers_vars.timersBuf[i].currentCompareValue-opentimers_vars.lastTimeout;\n+ tempTimerGap = opentimers_vars.timersBuf[i].currentCompareValue-opentimers_vars.lastCompareValue;\nif (tempTimerGap < timerGap){\n// timer \"i\" is more close to lastCompare value\ntimerGap = tempTimerGap;\n@@ -233,8 +234,8 @@ void opentimers_scheduleAbsolute(opentimers_id_t id,\n}\n// if I got here, assign the next to be fired timer to given timer\n- opentimers_vars.currentTimeout = opentimers_vars.timersBuf[idToSchedule].currentCompareValue;\n- sctimer_setCompare(opentimers_vars.currentTimeout);\n+ opentimers_vars.currentCompareValue = opentimers_vars.timersBuf[idToSchedule].currentCompareValue;\n+ sctimer_setCompare(opentimers_vars.currentCompareValue);\n}\nopentimers_vars.running = TRUE;\n}\n@@ -280,12 +281,12 @@ PORT_TIMER_WIDTH opentimers_getValue(void){\n}\n/**\n-\\brief get the currentTimeout variable of opentimer2.\n+\\brief get the currentCompareValue variable of opentimer2.\n-\\returns currentTimeout.\n+\\returns currentCompareValue.\n*/\n-PORT_TIMER_WIDTH opentimers_getCurrentTimeout(void){\n- return opentimers_vars.currentTimeout;\n+PORT_TIMER_WIDTH opentimers_getCurrentCompareValue(void){\n+ return opentimers_vars.currentCompareValue;\n}\n/**\n@@ -316,7 +317,7 @@ void opentimers_timer_callback(void){\nopentimers_vars.insideISR = TRUE;\nfor (i=0;i<MAX_NUM_TIMERS;i++){\nif (opentimers_vars.timersBuf[i].isrunning==TRUE){\n- if (opentimers_vars.currentTimeout == opentimers_vars.timersBuf[i].currentCompareValue){\n+ if (opentimers_vars.currentCompareValue == opentimers_vars.timersBuf[i].currentCompareValue){\n// this timer expired, mark as expired\nopentimers_vars.timersBuf[i].lastCompareValue = opentimers_vars.timersBuf[i].currentCompareValue;\nif (opentimers_vars.timersBuf[i].wraps_remaining==0){\n@@ -329,7 +330,7 @@ void opentimers_timer_callback(void){\nif (opentimers_vars.timersBuf[i].timerType==TIMER_PERIODIC){\nopentimers_scheduleIn(\ni,\n- opentimers_vars.timersBuf[i].totalTimerPeriod,\n+ opentimers_vars.timersBuf[i].duration,\nTIME_TICS,\nTIMER_PERIODIC,\nopentimers_vars.timersBuf[i].callback\n@@ -339,7 +340,7 @@ void opentimers_timer_callback(void){\n} else {\nopentimers_vars.timersBuf[i].wraps_remaining--;\nif (opentimers_vars.timersBuf[i].wraps_remaining == 0){\n- opentimers_vars.timersBuf[i].currentCompareValue = (opentimers_vars.timersBuf[i].totalTimerPeriod+opentimers_vars.timersBuf[i].lastCompareValue) & MAX_TICKS_IN_SINGLE_CLOCK;\n+ opentimers_vars.timersBuf[i].currentCompareValue = (opentimers_vars.timersBuf[i].duration+opentimers_vars.timersBuf[i].lastCompareValue) & MAX_TICKS_IN_SINGLE_CLOCK;\n} else {\nopentimers_vars.timersBuf[i].currentCompareValue = opentimers_vars.timersBuf[i].lastCompareValue + MAX_TICKS_IN_SINGLE_CLOCK;\n}\n@@ -347,7 +348,7 @@ void opentimers_timer_callback(void){\n}\n}\n}\n- opentimers_vars.lastTimeout = opentimers_vars.currentTimeout;\n+ opentimers_vars.lastCompareValue = opentimers_vars.currentCompareValue;\n// find the next timer to be fired\ni = 0;\n@@ -355,11 +356,11 @@ void opentimers_timer_callback(void){\ni++;\n}\nif(i<MAX_NUM_TIMERS){\n- timerGap = opentimers_vars.timersBuf[i].currentCompareValue+opentimers_vars.timersBuf[i].wraps_remaining*MAX_TICKS_IN_SINGLE_CLOCK-opentimers_vars.lastTimeout;\n+ timerGap = opentimers_vars.timersBuf[i].currentCompareValue+opentimers_vars.timersBuf[i].wraps_remaining*MAX_TICKS_IN_SINGLE_CLOCK-opentimers_vars.lastCompareValue;\nidToSchedule = i;\nfor (i=idToSchedule+1;i<MAX_NUM_TIMERS;i++){\nif (opentimers_vars.timersBuf[i].isrunning){\n- tempTimerGap = opentimers_vars.timersBuf[i].currentCompareValue-opentimers_vars.lastTimeout;\n+ tempTimerGap = opentimers_vars.timersBuf[i].currentCompareValue-opentimers_vars.lastCompareValue;\nif (tempTimerGap < timerGap){\ntimerGap = tempTimerGap;\nidToSchedule = i;\n@@ -368,10 +369,10 @@ void opentimers_timer_callback(void){\n}\n// reschedule the timer\n- opentimers_vars.currentTimeout = opentimers_vars.timersBuf[idToSchedule].currentCompareValue;\n- opentimers_vars.lastCompare[opentimers_vars.index] = opentimers_vars.currentTimeout;\n+ opentimers_vars.currentCompareValue = opentimers_vars.timersBuf[idToSchedule].currentCompareValue;\n+ opentimers_vars.lastCompare[opentimers_vars.index] = opentimers_vars.currentCompareValue;\nopentimers_vars.index = (opentimers_vars.index+1)&0x0F;\n- sctimer_setCompare(opentimers_vars.currentTimeout);\n+ sctimer_setCompare(opentimers_vars.currentCompareValue);\nopentimers_vars.running = TRUE;\n} else {\nopentimers_vars.running = FALSE;\n"
},
{
"change_type": "MODIFY",
"old_path": "drivers/common/opentimers.h",
"new_path": "drivers/common/opentimers.h",
"diff": "//=========================== define ==========================================\n-\n/// Maximum number of timers that can run concurrently\n#define MAX_NUM_TIMERS 10\n#define MAX_TICKS_IN_SINGLE_CLOCK (uint32_t)(((PORT_TIMER_WIDTH)0xFFFFFFFF)>>1)\n@@ -44,7 +43,7 @@ typedef enum {\n} time_type_t;\ntypedef struct {\n- uint32_t totalTimerPeriod; // the total period of timer\n+ uint32_t duration; // the duration that set by timer, in ticks\nPORT_TIMER_WIDTH currentCompareValue;// the current compare value\nuint16_t wraps_remaining; // the number of wraps timer is going to be fired after\nPORT_TIMER_WIDTH lastCompareValue; // the previous compare value\n@@ -61,8 +60,8 @@ typedef struct {\ntypedef struct {\nopentimers_t timersBuf[MAX_NUM_TIMERS];\nbool running;\n- PORT_TIMER_WIDTH currentTimeout; // current timeout, in ticks\n- PORT_TIMER_WIDTH lastTimeout; // last timeout, in ticks. This is the reference time to calculate the next to be expired timer.\n+ PORT_TIMER_WIDTH currentCompareValue;// current timeout, in ticks\n+ PORT_TIMER_WIDTH lastCompareValue; // last timeout, in ticks. This is the reference time to calculate the next to be expired timer.\nPORT_TIMER_WIDTH lastCompare[16]; // for debugging purpose\nuint8_t index; // index for lastCompare array\nbool insideISR; // whether the function of opentimer is called inside of ISR or not\n@@ -86,7 +85,7 @@ void opentimers_cancel(opentimers_id_t id);\nbool opentimers_destroy(opentimers_id_t id);\nPORT_TIMER_WIDTH opentimers_getValue(void);\n-PORT_TIMER_WIDTH opentimers_getCurrentTimeout(void);\n+PORT_TIMER_WIDTH opentimers_getCurrentCompareValue(void);\nbool opentimers_isRunning(opentimers_id_t id);\n/**\n\\}\n"
},
{
"change_type": "MODIFY",
"old_path": "openapps/cinfrared/cinfrared.c",
"new_path": "openapps/cinfrared/cinfrared.c",
"diff": "@@ -107,7 +107,7 @@ void cinrared_turnOnOrOff(uint8_t turnOnOrOff){\nswitch(cinfrared_vars.state){\ncase APP_STATE_START:\npwm_enable();\n- cinfrared_vars.startOfSlot = opentimers_getCurrentTimeout();\n+ cinfrared_vars.startOfSlot = opentimers_getCurrentCompareValue();\nif (turnOnOrOff){\nopentimers_scheduleAbsolute(\ncinfrared_vars.timerId,\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02a-MAClow/IEEE802154E.c",
"new_path": "openstack/02a-MAClow/IEEE802154E.c",
"diff": "@@ -280,7 +280,7 @@ This function executes in ISR mode, when the new slot timer fires.\n*/\nvoid isr_ieee154e_newSlot(opentimers_id_t id) {\n- ieee154e_vars.startOfSlotReference = opentimers_getCurrentTimeout();\n+ ieee154e_vars.startOfSlotReference = opentimers_getCurrentCompareValue();\nopentimers_scheduleAbsolute(\nieee154e_vars.timerId, // timerId\nTsSlotDuration, // duration\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/python/SConscript.env",
"new_path": "projects/python/SConscript.env",
"diff": "@@ -440,7 +440,7 @@ functionsToChange = [\n'opentimers_cancel',\n'opentimers_destroy',\n'opentimers_getValue',\n- 'opentimers_getCurrentTimeout',\n+ 'opentimers_getCurrentCompareValue',\n'opentimers_isRunning',\n'opentimers_timer_callback',\n#===== kernel\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-540. rephrase variables name.
|
491,595 |
18.04.2018 12:38:48
| -7,200 |
b8b0a6e47e3d8fdb8e59a09448dd3c2d5bb69bfd
|
update debugpins of openmote-cc2538
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/openmote-cc2538/debugpins.c",
"new_path": "bsp/boards/openmote-cc2538/debugpins.c",
"diff": "#define BSP_PINA_BASE GPIO_A_BASE\n#define BSP_PIND_BASE GPIO_D_BASE\n-#define BSP_PINA_4 GPIO_PIN_4 //!< PA4 -- frame -RF1.5\n-#define BSP_PINA_5 GPIO_PIN_5 //!< PA5 -- isr -RF1.11\n-\n-#define BSP_PIND_3 GPIO_PIN_3 //!< PD3 -- slot -RF1.6\n-#define BSP_PIND_2 GPIO_PIN_2 //!< PD2 -- fsm -RF1.8\n-#define BSP_PIND_1 GPIO_PIN_1 //!< PD1 -- task -RF1.10\n-#define BSP_PINA_2 GPIO_PIN_2 //!< PA2 -- radio -RF1-12\n+#define BSP_PINA_2 GPIO_PIN_2 //!< PA2 -- radio AD4/DIO4\n+#define BSP_PINA_3 GPIO_PIN_3 //!< PA3 -- isruarttx CTS/DIO7\n+#define BSP_PINA_4 GPIO_PIN_4 //!< PA4 -- frame AD5/DIO5\n+#define BSP_PINA_5 GPIO_PIN_5 //!< PA5 -- isr RTS/AD6/DIO6\n+#define BSP_PINA_6 GPIO_PIN_6 //!< PA6 -- isruartrx ON/SLEEP\n+\n+#define BSP_PIND_3 GPIO_PIN_3 //!< PD3 -- slot AD0/DIO0\n+#define BSP_PIND_2 GPIO_PIN_2 //!< PD2 -- fsm AD1/DIO1\n+#define BSP_PIND_1 GPIO_PIN_1 //!< PD1 -- task AD2/DIO2\n//=========================== variables =======================================\n//=========================== prototypes ======================================\n@@ -37,7 +39,7 @@ void debugpins_init(void) {\nGPIOPinTypeGPIOOutput(BSP_PINA_BASE, BSP_PINA_2 | BSP_PINA_4 | BSP_PINA_5);\nGPIOPinTypeGPIOOutput(BSP_PIND_BASE, BSP_PIND_3 | BSP_PIND_2 | BSP_PIND_1);\n- GPIOPinWrite(BSP_PINA_BASE, (BSP_PINA_2 | BSP_PINA_4 | BSP_PINA_5), 0x00);\n+ GPIOPinWrite(BSP_PINA_BASE, (BSP_PINA_2 | BSP_PINA_3 | BSP_PINA_4 | BSP_PINA_5 | BSP_PINA_6), 0x00);\nGPIOPinWrite(BSP_PIND_BASE, (BSP_PIND_3 | BSP_PIND_2 | BSP_PIND_1), 0);\n}\n@@ -85,6 +87,28 @@ void debugpins_task_set(void) {\nGPIOPinWrite(BSP_PIND_BASE, BSP_PIND_1, BSP_PIND_1);\n}\n+// PA3 isruarttx\n+void debugpins_isruarttx_toggle(void) {\n+ bspDBpinToggle(BSP_PINA_BASE, BSP_PINA_3);\n+}\n+void debugpins_isruarttx_clr(void) {\n+ GPIOPinWrite(BSP_PINA_BASE, BSP_PINA_3, 0);\n+}\n+void debugpins_isruarttx_set(void) {\n+ GPIOPinWrite(BSP_PINA_BASE, BSP_PINA_3, BSP_PINA_3);\n+}\n+\n+// PA6 isruartrx\n+void debugpins_isruartrx_toggle(void) {\n+ bspDBpinToggle(BSP_PINA_BASE, BSP_PINA_6);\n+}\n+void debugpins_isruartrx_clr(void) {\n+ GPIOPinWrite(BSP_PINA_BASE, BSP_PINA_6, 0);\n+}\n+void debugpins_isruartrx_set(void) {\n+ GPIOPinWrite(BSP_PINA_BASE, BSP_PINA_6, BSP_PINA_6);\n+}\n+\n// PA5\nvoid debugpins_isr_toggle(void) {\nbspDBpinToggle(BSP_PINA_BASE, BSP_PINA_5);\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/openmote-cc2538/uart.c",
"new_path": "bsp/boards/openmote-cc2538/uart.c",
"diff": "@@ -141,25 +141,26 @@ void uart_setCTS(bool state){\nstatic void uart_isr_private(void){\nuint32_t reg;\n- debugpins_isr_set();\n// Read interrupt source\nreg = UARTIntStatus(UART0_BASE, true);\n// Clear UART interrupt in the NVIC\nIntPendClear(INT_UART0);\n-\n// Process TX interrupt\nif(reg & UART_INT_TX){\n+ debugpins_isruarttx_set();\nuart_tx_isr();\n+ debugpins_isruarttx_clr();\n}\n+\n// Process RX interrupt\nif((reg & (UART_INT_RX)) || (reg & (UART_INT_RT))) {\n+ debugpins_isruartrx_set();\nuart_rx_isr();\n+ debugpins_isruartrx_clr();\n}\n-\n- debugpins_isr_clr();\n}\nkick_scheduler_t uart_tx_isr(void) {\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-540. update debugpins of openmote-cc2538
|
491,595 |
18.04.2018 15:00:34
| -7,200 |
f57a979ffa11ba4920f3d29a9e6df97e29dd8190
|
call sniffer_setListeningChannel in oos_sniffer.c file.
|
[
{
"change_type": "MODIFY",
"old_path": "drivers/common/openserial.c",
"new_path": "drivers/common/openserial.c",
"diff": "@@ -66,9 +66,6 @@ void inputHdlcOpen(void);\nvoid inputHdlcWrite(uint8_t b);\nvoid inputHdlcClose(void);\n-// sniffer\n-void sniffer_setListeningChannel(uint8_t channel);\n-\n//=========================== public ==========================================\n//===== admin\n@@ -740,8 +737,6 @@ void openserial_handleCommands(void){\ncomandParam_8 = openserial_vars.inputBuf[ptr];\n// set communication channel for protocol stack\nieee154e_setSingleChannel(comandParam_8); // one byte\n- // set listenning channel for sniffer\n- sniffer_setListeningChannel(comandParam_8); // one byte\nbreak;\ncase COMMAND_SET_KAPERIOD: // two bytes, in slots\ncomandParam_16 = (openserial_vars.inputBuf[ptr] & 0x00ff) | \\\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/common/03oos_openwsn/03oos_openwsn.c",
"new_path": "projects/common/03oos_openwsn/03oos_openwsn.c",
"diff": "@@ -16,11 +16,7 @@ int mote_main(void) {\nscheduler_init();\nopenstack_init();\n- // indicate\n-\n// start\nscheduler_start();\nreturn 0; // this line should never be reached\n}\n-\n-void sniffer_setListeningChannel(uint8_t channel){return;}\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/common/03oos_sniffer/03oos_sniffer.c",
"new_path": "projects/common/03oos_sniffer/03oos_sniffer.c",
"diff": "@@ -181,7 +181,9 @@ void task_uploadPacket(void) {\n}\n// ================================= stubbing ==================================\n-void ieee154e_setSingleChannel(uint8_t channel) {return;}\n+void ieee154e_setSingleChannel(uint8_t channel) {\n+ sniffer_setListeningChannel(channel);\n+}\nvoid ieee154e_setIsSecurityEnabled(bool isEnabled) {return;}\nvoid ieee154e_setSlotDuration(uint16_t duration) {return;}\nvoid ieee154e_setIsAckEnabled(bool isEnabled) {return;}\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-740. call sniffer_setListeningChannel in oos_sniffer.c file.
|
491,595 |
18.04.2018 16:44:19
| -7,200 |
deed427fbc797d87760da39cfee9019a3c1b3e66
|
protect the opentimer operations in non-interrupt mode.
|
[
{
"change_type": "MODIFY",
"old_path": "drivers/common/opentimers.c",
"new_path": "drivers/common/opentimers.c",
"diff": "@@ -9,8 +9,10 @@ at most MAX_NUM_TIMERS timers.\n#include \"opendefs.h\"\n#include \"opentimers.h\"\n+// some dsp modules are required\n#include \"sctimer.h\"\n-#include \"leds.h\"\n+#include \"debugpins.h\"\n+// kernel module is required\n#include \"scheduler.h\"\n//=========================== define ==========================================\n@@ -52,6 +54,9 @@ create a timer by assigning an Id and priority for the timer\nopentimers_id_t opentimers_create(uint8_t priority){\nuint8_t id;\n+ INTERRUPT_DECLARATION();\n+ DISABLE_INTERRUPTS();\n+\nif (priority==0){\nif (opentimers_vars.timersBuf[0].isUsed == FALSE){\nopentimers_vars.timersBuf[0].isUsed = TRUE;\n@@ -67,6 +72,9 @@ opentimers_id_t opentimers_create(uint8_t priority){\n}\n}\n}\n+\n+ ENABLE_INTERRUPTS();\n+\n// there is no available buffer for this timer\nreturn ERROR_NO_AVAILABLE_ENTRIES;\n}\n@@ -92,6 +100,10 @@ void opentimers_scheduleIn(opentimers_id_t id,\nuint8_t idToSchedule;\nPORT_TIMER_WIDTH timerGap;\nPORT_TIMER_WIDTH tempTimerGap;\n+\n+ INTERRUPT_DECLARATION();\n+ DISABLE_INTERRUPTS();\n+\n// 1. make sure the timer exist\nfor (i=0;i<MAX_NUM_TIMERS;i++){\nif (opentimers_vars.timersBuf[i].isUsed && i == id){\n@@ -152,6 +164,8 @@ void opentimers_scheduleIn(opentimers_id_t id,\nsctimer_setCompare(opentimers_vars.currentCompareValue);\n}\nopentimers_vars.running = TRUE;\n+\n+ ENABLE_INTERRUPTS();\n}\n/**\n@@ -177,6 +191,9 @@ void opentimers_scheduleAbsolute(opentimers_id_t id,\nPORT_TIMER_WIDTH timerGap;\nPORT_TIMER_WIDTH tempTimerGap;\n+ INTERRUPT_DECLARATION();\n+ DISABLE_INTERRUPTS();\n+\n// 1. make sure the timer exist\nfor (i=0;i<MAX_NUM_TIMERS;i++){\nif (opentimers_vars.timersBuf[i].isUsed && i == id){\n@@ -238,6 +255,8 @@ void opentimers_scheduleAbsolute(opentimers_id_t id,\nsctimer_setCompare(opentimers_vars.currentCompareValue);\n}\nopentimers_vars.running = TRUE;\n+\n+ ENABLE_INTERRUPTS();\n}\n/**\n@@ -249,8 +268,14 @@ isrunning as false. The timer may be recover later.\n\\param[in] id the timer id\n*/\nvoid opentimers_cancel(opentimers_id_t id){\n+\n+ INTERRUPT_DECLARATION();\n+ DISABLE_INTERRUPTS();\n+\nopentimers_vars.timersBuf[id].isrunning = FALSE;\nopentimers_vars.timersBuf[id].callback = NULL;\n+\n+ ENABLE_INTERRUPTS();\n}\n/**\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-749. protect the opentimer operations in non-interrupt mode.
|
491,595 |
18.04.2018 17:40:11
| -7,200 |
13e0219ff6d9ac966ac5c14e2f60666191a881fa
|
update openmote-b debugpins.c implementation.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/openmote-b/debugpins.c",
"new_path": "bsp/boards/openmote-b/debugpins.c",
"diff": "//=========================== defines =========================================\n// Board dbPINS defines\n#define BSP_PINA_BASE GPIO_A_BASE\n-#define BSP_PIND_BASE GPIO_D_BASE\n+#define BSP_PINB_BASE GPIO_B_BASE\n+#define BSP_PINC_BASE GPIO_C_BASE\n-#define BSP_PINA_4 GPIO_PIN_4 //!< PA4 -- frame -RF1.5\n-#define BSP_PINA_5 GPIO_PIN_5 //!< PA5 -- isr -RF1.11\n+#define BSP_PINA_7 GPIO_PIN_7 // PA7 -- frame\n+#define BSP_PINC_3 GPIO_PIN_3 // PC3 -- slot\n-#define BSP_PIND_3 GPIO_PIN_3 //!< PD3 -- slot -RF1.6\n-#define BSP_PIND_2 GPIO_PIN_2 //!< PD2 -- fsm -RF1.8\n-#define BSP_PIND_1 GPIO_PIN_1 //!< PD1 -- task -RF1.10\n-#define BSP_PIND_0 GPIO_PIN_0 //!< PD0 -- radio -RF1-12\n+#define BSP_PINB_3 GPIO_PIN_3 // PB3 -- fsm\n+#define BSP_PINB_2 GPIO_PIN_2 // PB2 -- task\n+#define BSP_PINB_1 GPIO_PIN_1 // PB1 -- isr\n+#define BSP_PINB_0 GPIO_PIN_0 // PB0 -- radio\n//=========================== variables =======================================\n@@ -35,95 +36,106 @@ void bspDBpinToggle(uint32_t base,uint8_t ui8Pin);\n//=========================== public ==========================================\nvoid debugpins_init(void) {\n- GPIOPinTypeGPIOOutput(BSP_PINA_BASE, BSP_PINA_4 | BSP_PINA_5);\n- GPIOPinTypeGPIOOutput(BSP_PIND_BASE, BSP_PIND_3 | BSP_PIND_2 | BSP_PIND_1 | BSP_PIND_0);\n+ GPIOPinTypeGPIOOutput(BSP_PINA_BASE, BSP_PINA_7);\n+ GPIOPinTypeGPIOOutput(BSP_PINC_BASE, BSP_PINC_3);\n+ GPIOPinTypeGPIOOutput(BSP_PINB_BASE, BSP_PINB_3 | BSP_PINB_2 | BSP_PINB_1 | BSP_PINB_0);\n- GPIOPinWrite(BSP_PINA_BASE, (BSP_PINA_4 | BSP_PINA_5), 0x00);\n- GPIOPinWrite(BSP_PIND_BASE, (BSP_PIND_3 | BSP_PIND_2 | BSP_PIND_1 | BSP_PIND_0), 0);\n+ GPIOPinWrite(BSP_PINA_BASE, BSP_PINA_7, 0x00);\n+ GPIOPinWrite(BSP_PINC_BASE, BSP_PINC_3, 0x00);\n+ GPIOPinWrite(BSP_PINB_BASE, (BSP_PINB_3 | BSP_PINB_2 | BSP_PINB_1 | BSP_PINB_0), 0x00);\n}\n-// PA4\n+// PA7\nvoid debugpins_frame_toggle(void) {\n- bspDBpinToggle(BSP_PINA_BASE, BSP_PINA_4);\n+ bspDBpinToggle(BSP_PINA_BASE, BSP_PINA_7);\n}\nvoid debugpins_frame_clr(void) {\n- GPIOPinWrite(BSP_PINA_BASE, BSP_PINA_4, 0);\n+ GPIOPinWrite(BSP_PINA_BASE, BSP_PINA_7, 0);\n}\nvoid debugpins_frame_set(void) {\n- GPIOPinWrite(BSP_PINA_BASE, BSP_PINA_4, BSP_PINA_4);\n+ GPIOPinWrite(BSP_PINA_BASE, BSP_PINA_7, BSP_PINA_7);\n}\n-// PD3\n+// PC3\nvoid debugpins_slot_toggle(void) {\n- bspDBpinToggle(BSP_PIND_BASE, BSP_PIND_3);\n+ bspDBpinToggle(BSP_PINC_BASE, BSP_PINC_3);\n}\nvoid debugpins_slot_clr(void) {\n- GPIOPinWrite(BSP_PIND_BASE, BSP_PIND_3, 0);\n+ GPIOPinWrite(BSP_PINC_BASE, BSP_PINC_3, 0);\n}\nvoid debugpins_slot_set(void) {\n- GPIOPinWrite(BSP_PIND_BASE, BSP_PIND_3, BSP_PIND_3);\n+ GPIOPinWrite(BSP_PINC_BASE, BSP_PINC_3, BSP_PINC_3);\n}\n-// PD2\n+// PB3\nvoid debugpins_fsm_toggle(void) {\n- bspDBpinToggle(BSP_PIND_BASE, BSP_PIND_2);\n+ bspDBpinToggle(BSP_PINB_BASE, BSP_PINB_3);\n}\nvoid debugpins_fsm_clr(void) {\n- GPIOPinWrite(BSP_PIND_BASE, BSP_PIND_2, 0);\n+ GPIOPinWrite(BSP_PINB_BASE, BSP_PINB_3, 0);\n}\nvoid debugpins_fsm_set(void) {\n- GPIOPinWrite(BSP_PIND_BASE, BSP_PIND_2, BSP_PIND_2);\n+ GPIOPinWrite(BSP_PINB_BASE, BSP_PINB_3, BSP_PINB_3);\n}\n-// PD1\n+// PB2\nvoid debugpins_task_toggle(void) {\n- bspDBpinToggle(BSP_PIND_BASE,BSP_PIND_1);\n+ bspDBpinToggle(BSP_PINB_BASE,BSP_PINB_2);\n}\nvoid debugpins_task_clr(void) {\n- GPIOPinWrite(BSP_PIND_BASE, BSP_PIND_1, 0);\n+ GPIOPinWrite(BSP_PINB_BASE, BSP_PINB_2, 0);\n}\nvoid debugpins_task_set(void) {\n- GPIOPinWrite(BSP_PIND_BASE, BSP_PIND_1, BSP_PIND_1);\n+ GPIOPinWrite(BSP_PINB_BASE, BSP_PINB_2, BSP_PINB_2);\n}\n-// PA5\n+// isruarttx: not provided by openmote-b\n+void debugpins_isruarttx_toggle(void) {\n+}\n+void debugpins_isruarttx_clr(void) {\n+}\n+void debugpins_isruarttx_set(void) {\n+}\n+\n+// isruartrx: not provided by openmote-b\n+void debugpins_isruartrx_toggle(void) {\n+}\n+void debugpins_isruartrx_clr(void) {\n+}\n+void debugpins_isruartrx_set(void) {\n+}\n+\n+// PB1\nvoid debugpins_isr_toggle(void) {\n- bspDBpinToggle(BSP_PINA_BASE, BSP_PINA_5);\n+ bspDBpinToggle(BSP_PINB_BASE, BSP_PINB_1);\n}\nvoid debugpins_isr_clr(void) {\n- GPIOPinWrite(BSP_PINA_BASE, BSP_PINA_5, 0);\n+ GPIOPinWrite(BSP_PINB_BASE, BSP_PINB_1, 0);\n}\nvoid debugpins_isr_set(void) {\n- GPIOPinWrite(BSP_PINA_BASE, BSP_PINA_5, BSP_PINA_5);\n+ GPIOPinWrite(BSP_PINB_BASE, BSP_PINB_1, BSP_PINB_1);\n}\n-// PD0\n+// PB0\nvoid debugpins_radio_toggle(void) {\n- bspDBpinToggle(BSP_PIND_BASE, BSP_PIND_0);\n+ bspDBpinToggle(BSP_PINB_BASE, BSP_PINB_0);\n}\nvoid debugpins_radio_clr(void) {\n- GPIOPinWrite(BSP_PIND_BASE, BSP_PIND_0, 0);\n+ GPIOPinWrite(BSP_PINB_BASE, BSP_PINB_0, 0);\n}\nvoid debugpins_radio_set(void) {\n- GPIOPinWrite(BSP_PIND_BASE, BSP_PIND_0, BSP_PIND_0);\n+ GPIOPinWrite(BSP_PINB_BASE, BSP_PINB_0, BSP_PINB_0);\n}\n-//------------ private ------------//\n+//------------ private ------------\n-void bspDBpinToggle(uint32_t base, uint8_t ui8Pin)\n-{\n- //\n+void bspDBpinToggle(uint32_t base, uint8_t ui8Pin){\n// Get current pin values of selected bits\n- //\nuint32_t ui32Toggle = GPIOPinRead(base, ui8Pin);\n- //\n// Invert selected bits\n- //\nui32Toggle = (~ui32Toggle) & ui8Pin;\n- //\n// Set GPIO\n- //\nGPIOPinWrite(base, ui8Pin, ui32Toggle);\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/openmote-b/uart.c",
"new_path": "bsp/boards/openmote-b/uart.c",
"diff": "typedef struct {\nuart_tx_cbt txCb;\nuart_rx_cbt rxCb;\n+ bool fXonXoffEscaping;\n+ uint8_t xonXoffEscapedByte;\n} uart_vars_t;\nuart_vars_t uart_vars;\n@@ -111,8 +113,14 @@ void uart_clearTxInterrupts(void) {\n}\nvoid uart_writeByte(uint8_t byteToWrite){\n+ if (byteToWrite==XON || byteToWrite==XOFF || byteToWrite==XONXOFF_ESCAPE) {\n+ uart_vars.fXonXoffEscaping = 0x01;\n+ uart_vars.xonXoffEscapedByte = byteToWrite;\n+ UARTCharPut(UART0_BASE,XONXOFF_ESCAPE);\n+ } else {\nUARTCharPut(UART0_BASE,byteToWrite);\n}\n+}\nuint8_t uart_readByte(void) {\nint32_t i32Char;\n@@ -120,10 +128,20 @@ uint8_t uart_readByte(void) {\nreturn (uint8_t)(i32Char & 0xFF);\n}\n+void uart_setCTS(bool state){\n+ if (state==0x01) {\n+ UARTCharPut(UART0_BASE, XON);\n+ } else {\n+ UARTCharPut(UART0_BASE, XOFF);\n+ }\n+}\n+\n+\n//=========================== interrupt handlers ==============================\nstatic void uart_isr_private(void){\nuint32_t reg;\n+\ndebugpins_isr_set();\n// Read interrupt source\n@@ -131,7 +149,6 @@ static void uart_isr_private(void){\n// Clear UART interrupt in the NVIC\nIntPendClear(INT_UART0);\n-\n// Process TX interrupt\nif(reg & UART_INT_TX){\nuart_tx_isr();\n@@ -147,9 +164,14 @@ static void uart_isr_private(void){\nkick_scheduler_t uart_tx_isr(void) {\nuart_clearTxInterrupts(); // TODO: do not clear, but disable when done\n+ if (uart_vars.fXonXoffEscaping==0x01) {\n+ uart_vars.fXonXoffEscaping = 0x00;\n+ UARTCharPut(UART0_BASE,uart_vars.xonXoffEscapedByte^XONXOFF_MASK);\n+ } else {\nif (uart_vars.txCb != NULL) {\nuart_vars.txCb();\n}\n+ }\nreturn DO_NOT_KICK_SCHEDULER;\n}\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-752. update openmote-b debugpins.c implementation.
|
491,595 |
19.04.2018 15:42:55
| -7,200 |
80e58730cc8d451bc1594aa4596d6ddf60e1e02e
|
split opentimer callback into two when it's inhibit timer fired.
|
[
{
"change_type": "MODIFY",
"old_path": "drivers/common/opentimers.c",
"new_path": "drivers/common/opentimers.c",
"diff": "@@ -57,14 +57,21 @@ opentimers_id_t opentimers_create(uint8_t priority){\nINTERRUPT_DECLARATION();\nDISABLE_INTERRUPTS();\n- if (priority==0){\n- if (opentimers_vars.timersBuf[0].isUsed == FALSE){\n- opentimers_vars.timersBuf[0].isUsed = TRUE;\n- opentimers_vars.timersBuf[0].priority = 0;\n- return 0;\n+ if (priority==TSCH_TIMER_PRIORITY){\n+ if (opentimers_vars.timersBuf[TSCH_TIMER_ID].isUsed == FALSE){\n+ opentimers_vars.timersBuf[TSCH_TIMER_ID].isUsed = TRUE;\n+ opentimers_vars.timersBuf[TSCH_TIMER_ID].priority = TSCH_TIMER_PRIORITY;\n+ return TSCH_TIMER_ID;\n}\n} else {\n- for (id=1;id<MAX_NUM_TIMERS;id++){\n+ if (priority==INHIBIT_TIMER_PRIORITY){\n+ if (opentimers_vars.timersBuf[INHIBIT_TIMER_ID].isUsed == FALSE){\n+ opentimers_vars.timersBuf[INHIBIT_TIMER_ID].isUsed = TRUE;\n+ opentimers_vars.timersBuf[INHIBIT_TIMER_ID].priority = INHIBIT_TIMER_PRIORITY;\n+ return INHIBIT_TIMER_ID;\n+ }\n+ } else {\n+ for (id=2;id<MAX_NUM_TIMERS;id++){\nif (opentimers_vars.timersBuf[id].isUsed == FALSE){\nopentimers_vars.timersBuf[id].isUsed = TRUE;\nopentimers_vars.timersBuf[id].priority = priority;\n@@ -72,6 +79,7 @@ opentimers_id_t opentimers_create(uint8_t priority){\n}\n}\n}\n+ }\nENABLE_INTERRUPTS();\n@@ -339,18 +347,32 @@ void opentimers_timer_callback(void){\nPORT_TIMER_WIDTH timerGap;\nPORT_TIMER_WIDTH tempTimerGap;\n- opentimers_vars.insideISR = TRUE;\n+ if (opentimers_vars.timerSplited==FALSE){\n+ if (\n+ opentimers_vars.timersBuf[INHIBIT_TIMER_ID].isrunning==TRUE &&\n+ opentimers_vars.currentCompareValue == opentimers_vars.timersBuf[INHIBIT_TIMER_ID].currentCompareValue\n+ ){\n+ opentimers_vars.timersBuf[INHIBIT_TIMER_ID].lastCompareValue = opentimers_vars.timersBuf[INHIBIT_TIMER_ID].currentCompareValue;\n+ opentimers_vars.timersBuf[INHIBIT_TIMER_ID].isrunning = FALSE;\n+ opentimers_vars.timersBuf[INHIBIT_TIMER_ID].callback(INHIBIT_TIMER_ID);\n+ opentimers_vars.timerSplited = TRUE;\n+ // the next timer selection will be done after SPLITE_TIMER_DURATION ticks\n+ sctimer_setCompare(sctimer_readCounter()+SPLITE_TIMER_DURATION);\n+ return;\n+ } else {\nfor (i=0;i<MAX_NUM_TIMERS;i++){\nif (opentimers_vars.timersBuf[i].isrunning==TRUE){\nif (opentimers_vars.currentCompareValue == opentimers_vars.timersBuf[i].currentCompareValue){\n// this timer expired, mark as expired\nopentimers_vars.timersBuf[i].lastCompareValue = opentimers_vars.timersBuf[i].currentCompareValue;\n- if (opentimers_vars.timersBuf[i].wraps_remaining==0){\n+ if (i==TSCH_TIMER_ID){\n+ opentimers_vars.insideISR = TRUE;\nopentimers_vars.timersBuf[i].isrunning = FALSE;\n- opentimers_vars.timersBuf[i].hasExpired = FALSE;\n- if (i==0){\n- opentimers_vars.timersBuf[0].callback(0);\n+ opentimers_vars.timersBuf[i].callback(i);\n+ opentimers_vars.insideISR = FALSE;\n} else {\n+ if (opentimers_vars.timersBuf[i].wraps_remaining==0){\n+ opentimers_vars.timersBuf[i].isrunning = FALSE;\nscheduler_push_task((task_cbt)(opentimers_vars.timersBuf[i].callback),TASKPRIO_OPENTIMERS);\nif (opentimers_vars.timersBuf[i].timerType==TIMER_PERIODIC){\nopentimers_scheduleIn(\n@@ -361,7 +383,6 @@ void opentimers_timer_callback(void){\nopentimers_vars.timersBuf[i].callback\n);\n}\n- }\n} else {\nopentimers_vars.timersBuf[i].wraps_remaining--;\nif (opentimers_vars.timersBuf[i].wraps_remaining == 0){\n@@ -373,7 +394,12 @@ void opentimers_timer_callback(void){\n}\n}\n}\n+ }\n+ }\nopentimers_vars.lastCompareValue = opentimers_vars.currentCompareValue;\n+ } else {\n+ opentimers_vars.timerSplited = FALSE;\n+ }\n// find the next timer to be fired\ni = 0;\n@@ -381,7 +407,7 @@ void opentimers_timer_callback(void){\ni++;\n}\nif(i<MAX_NUM_TIMERS){\n- timerGap = opentimers_vars.timersBuf[i].currentCompareValue+opentimers_vars.timersBuf[i].wraps_remaining*MAX_TICKS_IN_SINGLE_CLOCK-opentimers_vars.lastCompareValue;\n+ timerGap = opentimers_vars.timersBuf[i].currentCompareValue-opentimers_vars.lastCompareValue;\nidToSchedule = i;\nfor (i=idToSchedule+1;i<MAX_NUM_TIMERS;i++){\nif (opentimers_vars.timersBuf[i].isrunning){\n@@ -395,12 +421,8 @@ void opentimers_timer_callback(void){\n// reschedule the timer\nopentimers_vars.currentCompareValue = opentimers_vars.timersBuf[idToSchedule].currentCompareValue;\n- opentimers_vars.lastCompare[opentimers_vars.index] = opentimers_vars.currentCompareValue;\n- opentimers_vars.index = (opentimers_vars.index+1)&0x0F;\nsctimer_setCompare(opentimers_vars.currentCompareValue);\n- opentimers_vars.running = TRUE;\n} else {\nopentimers_vars.running = FALSE;\n}\n- opentimers_vars.insideISR = FALSE;\n}\n\\ No newline at end of file\n"
},
{
"change_type": "MODIFY",
"old_path": "drivers/common/opentimers.h",
"new_path": "drivers/common/opentimers.h",
"diff": "#define MAX_DURATION_ISR 33 // 33@32768Hz = 1ms\n#define opentimers_id_t uint8_t\n-#define HIGHEST_PRIORITY 0\n+#define INHIBITE_TIMER_PRIORITY 0\n+#define TSCH_TIMER_PRIORITY 1\n#define DEFAULT_PRIORITY 255\n+#define INHIBITE_TIMER_ID 0\n+#define TSCH_TIMER_ID 1\n+\n+#define SPLITE_TIMER_DURATION 15 // in ticks\n+\ntypedef void (*opentimers_cbt)(opentimers_id_t id);\n//=========================== typedef =========================================\n@@ -62,9 +68,8 @@ typedef struct {\nbool running;\nPORT_TIMER_WIDTH currentCompareValue;// current timeout, in ticks\nPORT_TIMER_WIDTH lastCompareValue; // last timeout, in ticks. This is the reference time to calculate the next to be expired timer.\n- PORT_TIMER_WIDTH lastCompare[16]; // for debugging purpose\n- uint8_t index; // index for lastCompare array\nbool insideISR; // whether the function of opentimer is called inside of ISR or not\n+ bool timerSplited;\n} opentimers_vars_t;\n//=========================== prototypes ======================================\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02a-MAClow/IEEE802154E.c",
"new_path": "openstack/02a-MAClow/IEEE802154E.c",
"diff": "@@ -153,7 +153,7 @@ void ieee154e_init(void) {\nradio_setStartFrameCb(ieee154e_startOfFrame);\nradio_setEndFrameCb(ieee154e_endOfFrame);\n// have the radio start its timer and assign ieee802154e timer with highest priority\n- ieee154e_vars.timerId = opentimers_create(HIGHEST_PRIORITY);\n+ ieee154e_vars.timerId = opentimers_create(TSCH_TIMER_PRIORITY);\nopentimers_scheduleAbsolute(\nieee154e_vars.timerId, // timerId\nieee154e_vars.slotDuration, // duration\n@@ -163,7 +163,7 @@ void ieee154e_init(void) {\n);\n// radiotimer_start(ieee154e_vars.slotDuration);\nIEEE802154_security_init();\n- ieee154e_vars.serialInhibitTimerId = opentimers_create(DEFAULT_PRIORITY);\n+ ieee154e_vars.serialInhibitTimerId = opentimers_create(INHIBIT_TIMER_PRIORITY);\n}\n//=========================== public ==========================================\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-540. split opentimer callback into two when it's inhibit timer fired.
|
491,595 |
19.04.2018 16:22:01
| -7,200 |
2478c96f2bf78e35d19aa38cef8d7e8738d4d66d
|
remove priority item and update macros' name.
|
[
{
"change_type": "MODIFY",
"old_path": "drivers/common/openserial.c",
"new_path": "drivers/common/openserial.c",
"diff": "@@ -179,7 +179,7 @@ owerror_t openserial_printCritical(\nleds_error_blink();\n// schedule for the mote to reboot in 10s\n- id = opentimers_create(DEFAULT_PRIORITY);\n+ id = opentimers_create(TIMER_GENERAL_PURPOSE);\nreference = opentimers_getValue();\nopentimers_scheduleAbsolute(\nid, // timerId\n"
},
{
"change_type": "MODIFY",
"old_path": "drivers/common/opentimers.c",
"new_path": "drivers/common/opentimers.c",
"diff": "@@ -33,13 +33,10 @@ void opentimers_timer_callback(void);\nInitializes data structures and hardware timer.\n*/\nvoid opentimers_init(void){\n- uint8_t i;\n+\n// initialize local variables\nmemset(&opentimers_vars,0,sizeof(opentimers_vars_t));\n- for (i=0;i<MAX_NUM_TIMERS;i++){\n- // by default, all timers have the priority of 0xff (lowest priority)\n- opentimers_vars.timersBuf[i].priority = 0xff;\n- }\n+\n// set callback for sctimer module\nsctimer_set_callback(opentimers_timer_callback);\n}\n@@ -51,35 +48,27 @@ create a timer by assigning an Id and priority for the timer\n\\returns the id of the timer will be returned\n*/\n-opentimers_id_t opentimers_create(uint8_t priority){\n+opentimers_id_t opentimers_create(uint8_t timer_id){\nuint8_t id;\nINTERRUPT_DECLARATION();\nDISABLE_INTERRUPTS();\n- if (priority==TSCH_TIMER_PRIORITY){\n- if (opentimers_vars.timersBuf[TSCH_TIMER_ID].isUsed == FALSE){\n- opentimers_vars.timersBuf[TSCH_TIMER_ID].isUsed = TRUE;\n- opentimers_vars.timersBuf[TSCH_TIMER_ID].priority = TSCH_TIMER_PRIORITY;\n- return TSCH_TIMER_ID;\n+ if (timer_id==TIMER_TSCH || timer_id==TIMER_INHIBIT){\n+ if (opentimers_vars.timersBuf[timer_id].isUsed == FALSE){\n+ opentimers_vars.timersBuf[timer_id].isUsed = TRUE;\n+ return timer_id;\n}\n- } else {\n- if (priority==INHIBIT_TIMER_PRIORITY){\n- if (opentimers_vars.timersBuf[INHIBIT_TIMER_ID].isUsed == FALSE){\n- opentimers_vars.timersBuf[INHIBIT_TIMER_ID].isUsed = TRUE;\n- opentimers_vars.timersBuf[INHIBIT_TIMER_ID].priority = INHIBIT_TIMER_PRIORITY;\n- return INHIBIT_TIMER_ID;\n}\n- } else {\n- for (id=2;id<MAX_NUM_TIMERS;id++){\n+\n+ if (timer_id==TIMER_GENERAL_PURPOSE){\n+ for (id=TIMER_NUMBER_NON_GENERAL;id<MAX_NUM_TIMERS;id++){\nif (opentimers_vars.timersBuf[id].isUsed == FALSE){\nopentimers_vars.timersBuf[id].isUsed = TRUE;\n- opentimers_vars.timersBuf[id].priority = priority;\nreturn id;\n}\n}\n}\n- }\nENABLE_INTERRUPTS();\n@@ -349,12 +338,12 @@ void opentimers_timer_callback(void){\nif (opentimers_vars.timerSplited==FALSE){\nif (\n- opentimers_vars.timersBuf[INHIBIT_TIMER_ID].isrunning==TRUE &&\n- opentimers_vars.currentCompareValue == opentimers_vars.timersBuf[INHIBIT_TIMER_ID].currentCompareValue\n+ opentimers_vars.timersBuf[TIMER_INHIBIT].isrunning==TRUE &&\n+ opentimers_vars.currentCompareValue == opentimers_vars.timersBuf[TIMER_INHIBIT].currentCompareValue\n){\n- opentimers_vars.timersBuf[INHIBIT_TIMER_ID].lastCompareValue = opentimers_vars.timersBuf[INHIBIT_TIMER_ID].currentCompareValue;\n- opentimers_vars.timersBuf[INHIBIT_TIMER_ID].isrunning = FALSE;\n- opentimers_vars.timersBuf[INHIBIT_TIMER_ID].callback(INHIBIT_TIMER_ID);\n+ opentimers_vars.timersBuf[TIMER_INHIBIT].lastCompareValue = opentimers_vars.timersBuf[TIMER_INHIBIT].currentCompareValue;\n+ opentimers_vars.timersBuf[TIMER_INHIBIT].isrunning = FALSE;\n+ opentimers_vars.timersBuf[TIMER_INHIBIT].callback(TIMER_INHIBIT);\nopentimers_vars.timerSplited = TRUE;\n// the next timer selection will be done after SPLITE_TIMER_DURATION ticks\nsctimer_setCompare(sctimer_readCounter()+SPLITE_TIMER_DURATION);\n@@ -365,7 +354,7 @@ void opentimers_timer_callback(void){\nif (opentimers_vars.currentCompareValue == opentimers_vars.timersBuf[i].currentCompareValue){\n// this timer expired, mark as expired\nopentimers_vars.timersBuf[i].lastCompareValue = opentimers_vars.timersBuf[i].currentCompareValue;\n- if (i==TSCH_TIMER_ID){\n+ if (i==TIMER_TSCH){\nopentimers_vars.insideISR = TRUE;\nopentimers_vars.timersBuf[i].isrunning = FALSE;\nopentimers_vars.timersBuf[i].callback(i);\n"
},
{
"change_type": "MODIFY",
"old_path": "drivers/common/opentimers.h",
"new_path": "drivers/common/opentimers.h",
"diff": "#define MAX_DURATION_ISR 33 // 33@32768Hz = 1ms\n#define opentimers_id_t uint8_t\n-#define INHIBIT_TIMER_PRIORITY 0\n-#define TSCH_TIMER_PRIORITY 1\n-#define DEFAULT_PRIORITY 255\n+#define TIMER_INHIBIT 0\n+#define TIMER_TSCH 1\n+#define TIMER_GENERAL_PURPOSE 255\n-#define INHIBIT_TIMER_ID 0\n-#define TSCH_TIMER_ID 1\n+#define TIMER_NUMBER_NON_GENERAL 2\n#define SPLITE_TIMER_DURATION 15 // in ticks\n@@ -57,7 +56,6 @@ typedef struct {\nbool isUsed; // true when this entry is occupied\ntimer_type_t timerType; // the timer type\nbool hasExpired; // in case there are more than one interrupt occur at same time\n- uint8_t priority; // high priority timer could take over the compare timer scheduled early than it for TIMERTHRESHOLD ticks.\nopentimers_cbt callback; // function to call when elapses\n} opentimers_t;\n"
},
{
"change_type": "MODIFY",
"old_path": "openapps/cexample/cexample.c",
"new_path": "openapps/cexample/cexample.c",
"diff": "@@ -56,7 +56,7 @@ void cexample_init(void) {\nopencoap_register(&cexample_vars.desc);\n- cexample_vars.timerId = opentimers_create(DEFAULT_PRIORITY);\n+ cexample_vars.timerId = opentimers_create(TIMER_GENERAL_PURPOSE);\nopentimers_scheduleIn(\ncexample_vars.timerId,\nCEXAMPLEPERIOD,\n"
},
{
"change_type": "MODIFY",
"old_path": "openapps/cinfrared/cinfrared.c",
"new_path": "openapps/cinfrared/cinfrared.c",
"diff": "@@ -53,7 +53,7 @@ void cinfrared_init(void) {\nopencoap_register(&cinfrared_vars.desc);\n- cinfrared_vars.timerId = opentimers_create(DEFAULT_PRIORITY);\n+ cinfrared_vars.timerId = opentimers_create(TIMER_GENERAL_PURPOSE);\n}\n//=========================== private =========================================\n"
},
{
"change_type": "MODIFY",
"old_path": "openapps/cjoin/cjoin.c",
"new_path": "openapps/cjoin/cjoin.c",
"diff": "@@ -74,7 +74,7 @@ void cjoin_init(void) {\nopencoap_register(&cjoin_vars.desc);\n- cjoin_vars.timerId = opentimers_create(DEFAULT_PRIORITY);\n+ cjoin_vars.timerId = opentimers_create(TIMER_GENERAL_PURPOSE);\nidmanager_setJoinKey((uint8_t *) masterSecret);\n"
},
{
"change_type": "MODIFY",
"old_path": "openapps/csensors/csensors.c",
"new_path": "openapps/csensors/csensors.c",
"diff": "@@ -408,7 +408,7 @@ void csensors_setPeriod(uint32_t period,\n);\n}\n} else {\n- csensors_vars.csensors_resource[id].timerId = opentimers_create(DEFAULT_PRIORITY);\n+ csensors_vars.csensors_resource[id].timerId = opentimers_create(TIMER_GENERAL_PURPOSE);\nopentimers_scheduleIn(\ncsensors_vars.csensors_resource[id].timerId,\n(uint32_t)((period*openrandom_get16b())/0xffff),\n"
},
{
"change_type": "MODIFY",
"old_path": "openapps/uexpiration/uexpiration.c",
"new_path": "openapps/uexpiration/uexpiration.c",
"diff": "@@ -70,7 +70,7 @@ void uexpiration_receive(OpenQueueEntry_t* request) {\nuexpiration_vars.period = pkt_interval;\n// start periodic timer\n- uexpiration_vars.timerId = opentimers_create(DEFAULT_PRIORITY);\n+ uexpiration_vars.timerId = opentimers_create(TIMER_GENERAL_PURPOSE);\nopentimers_scheduleIn(\nuexpiration_vars.timerId,\nuexpiration_vars.period,\n"
},
{
"change_type": "MODIFY",
"old_path": "openapps/uinject/uinject.c",
"new_path": "openapps/uinject/uinject.c",
"diff": "@@ -37,7 +37,7 @@ void uinject_init(void) {\nuinject_vars.period = UINJECT_PERIOD_MS;\n// start periodic timer\n- uinject_vars.timerId = opentimers_create(DEFAULT_PRIORITY);\n+ uinject_vars.timerId = opentimers_create(TIMER_GENERAL_PURPOSE);\nopentimers_scheduleIn(\nuinject_vars.timerId,\nUINJECT_PERIOD_MS,\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02a-MAClow/IEEE802154E.c",
"new_path": "openstack/02a-MAClow/IEEE802154E.c",
"diff": "@@ -153,7 +153,7 @@ void ieee154e_init(void) {\nradio_setStartFrameCb(ieee154e_startOfFrame);\nradio_setEndFrameCb(ieee154e_endOfFrame);\n// have the radio start its timer and assign ieee802154e timer with highest priority\n- ieee154e_vars.timerId = opentimers_create(TSCH_TIMER_PRIORITY);\n+ ieee154e_vars.timerId = opentimers_create(TIMER_TSCH);\nopentimers_scheduleAbsolute(\nieee154e_vars.timerId, // timerId\nieee154e_vars.slotDuration, // duration\n@@ -163,7 +163,7 @@ void ieee154e_init(void) {\n);\n// radiotimer_start(ieee154e_vars.slotDuration);\nIEEE802154_security_init();\n- ieee154e_vars.serialInhibitTimerId = opentimers_create(INHIBIT_TIMER_PRIORITY);\n+ ieee154e_vars.serialInhibitTimerId = opentimers_create(TIMER_INHIBIT);\n}\n//=========================== public ==========================================\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/msf.c",
"new_path": "openstack/02b-MAChigh/msf.c",
"diff": "@@ -45,7 +45,7 @@ void msf_init(void) {\n(sixtop_sf_translatemetadata)msf_translateMetadata,\n(sixtop_sf_handle_callback)msf_handleRCError\n);\n- msf_vars.housekeepingTimerId = opentimers_create(DEFAULT_PRIORITY);\n+ msf_vars.housekeepingTimerId = opentimers_create(TIMER_GENERAL_PURPOSE);\nmsf_vars.housekeepingPeriod = HOUSEKEEPING_PERIOD;\nopentimers_scheduleIn(\nmsf_vars.housekeepingTimerId,\n@@ -54,7 +54,7 @@ void msf_init(void) {\nTIMER_ONESHOT,\nmsf_timer_housekeeping_cb\n);\n- msf_vars.waitretryTimerId = opentimers_create(DEFAULT_PRIORITY);\n+ msf_vars.waitretryTimerId = opentimers_create(TIMER_GENERAL_PURPOSE);\n}\n// called by schedule\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/sixtop.c",
"new_path": "openstack/02b-MAChigh/sixtop.c",
"diff": "@@ -107,7 +107,7 @@ void sixtop_init(void) {\nsixtop_vars.isResponseEnabled = TRUE;\nsixtop_vars.six2six_state = SIX_STATE_IDLE;\n- sixtop_vars.ebSendingTimerId = opentimers_create(DEFAULT_PRIORITY);\n+ sixtop_vars.ebSendingTimerId = opentimers_create(TIMER_GENERAL_PURPOSE);\nopentimers_scheduleIn(\nsixtop_vars.ebSendingTimerId,\nSLOTFRAME_LENGTH*SLOTDURATION,\n@@ -116,7 +116,7 @@ void sixtop_init(void) {\nsixtop_sendingEb_timer_cb\n);\n- sixtop_vars.maintenanceTimerId = opentimers_create(DEFAULT_PRIORITY);\n+ sixtop_vars.maintenanceTimerId = opentimers_create(TIMER_GENERAL_PURPOSE);\nopentimers_scheduleIn(\nsixtop_vars.maintenanceTimerId,\nsixtop_vars.periodMaintenance,\n@@ -125,7 +125,7 @@ void sixtop_init(void) {\nsixtop_maintenance_timer_cb\n);\n- sixtop_vars.timeoutTimerId = opentimers_create(DEFAULT_PRIORITY);\n+ sixtop_vars.timeoutTimerId = opentimers_create(TIMER_GENERAL_PURPOSE);\n}\nvoid sixtop_setKaPeriod(uint16_t kaPeriod) {\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/03b-IPv6/icmpv6rpl.c",
"new_path": "openstack/03b-IPv6/icmpv6rpl.c",
"diff": "@@ -84,7 +84,7 @@ void icmpv6rpl_init(void) {\nmemcpy(&icmpv6rpl_vars.dioDestination.addr_128b[0],all_routers_multicast,sizeof(all_routers_multicast));\nicmpv6rpl_vars.dioPeriod = DIO_PERIOD;\n- icmpv6rpl_vars.timerIdDIO = opentimers_create(DEFAULT_PRIORITY);\n+ icmpv6rpl_vars.timerIdDIO = opentimers_create(TIMER_GENERAL_PURPOSE);\n//initialize PIO -> move this to dagroot code\nicmpv6rpl_vars.pio.type = RPL_OPTION_PIO;\n@@ -169,7 +169,7 @@ void icmpv6rpl_init(void) {\nicmpv6rpl_vars.dao_target.prefixLength = 0;\nicmpv6rpl_vars.daoPeriod = DAO_PERIOD;\n- icmpv6rpl_vars.timerIdDAO = opentimers_create(DEFAULT_PRIORITY);\n+ icmpv6rpl_vars.timerIdDAO = opentimers_create(TIMER_GENERAL_PURPOSE);\nopentimers_scheduleIn(\nicmpv6rpl_vars.timerIdDAO,\nopenrandom_getRandomizePeriod(icmpv6rpl_vars.daoPeriod, NUM_CHANNELS*SLOTFRAME_LENGTH*SLOTDURATION),\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-540. remove priority item and update macros' name.
|
491,595 |
19.04.2018 17:02:07
| -7,200 |
33d77c64ab772239ecd16c666e502bb94a8df7d5
|
flag insideISR to avoid find next timer twice.
|
[
{
"change_type": "MODIFY",
"old_path": "drivers/common/opentimers.c",
"new_path": "drivers/common/opentimers.c",
"diff": "@@ -364,6 +364,7 @@ void opentimers_timer_callback(void){\nopentimers_vars.timersBuf[i].isrunning = FALSE;\nscheduler_push_task((task_cbt)(opentimers_vars.timersBuf[i].callback),TASKPRIO_OPENTIMERS);\nif (opentimers_vars.timersBuf[i].timerType==TIMER_PERIODIC){\n+ opentimers_vars.insideISR = TRUE;\nopentimers_scheduleIn(\ni,\nopentimers_vars.timersBuf[i].duration,\n@@ -371,6 +372,7 @@ void opentimers_timer_callback(void){\nTIMER_PERIODIC,\nopentimers_vars.timersBuf[i].callback\n);\n+ opentimers_vars.insideISR = FALSE;\n}\n} else {\nopentimers_vars.timersBuf[i].wraps_remaining--;\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-540. flag insideISR to avoid find next timer twice.
|
491,595 |
20.04.2018 10:52:49
| -7,200 |
aa5b23f17ff169ad698fc4f179c2cf62665c5a7c
|
don't initialize hdlcLastRxByte as HDLC_FLAG.
|
[
{
"change_type": "MODIFY",
"old_path": "drivers/common/openserial.c",
"new_path": "drivers/common/openserial.c",
"diff": "@@ -81,7 +81,6 @@ void openserial_init(void) {\nopenserial_vars.debugPrintCounter = 0;\n// input\n- openserial_vars.hdlcLastRxByte = HDLC_FLAG;\nopenserial_vars.hdlcBusyReceiving = FALSE;\nopenserial_vars.hdlcInputEscaping = FALSE;\nopenserial_vars.inputBufFillLevel = 0;\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-754. don't initialize hdlcLastRxByte as HDLC_FLAG.
|
491,595 |
20.04.2018 11:44:41
| -7,200 |
736c83121e6bffdb21787942c48729b0c001254c
|
send an ACK to each received frame.
|
[
{
"change_type": "MODIFY",
"old_path": "drivers/common/openserial.c",
"new_path": "drivers/common/openserial.c",
"diff": "@@ -47,6 +47,10 @@ owerror_t openserial_printInfoErrorCritical(\nerrorparameter_t arg1,\nerrorparameter_t arg2\n);\n+owerror_t openserial_ackReply(\n+ bool positiveAck,\n+ bool hasFrameFollowed\n+);\n// command handlers\nvoid openserial_handleRxFrame(void);\n@@ -245,6 +249,27 @@ owerror_t openserial_printSniffedPacket(uint8_t* buffer, uint8_t length, uint8_t\nreturn E_SUCCESS;\n}\n+\n+owerror_t openserial_ackReply(bool positiveAck, bool hasFrameFollowed) {\n+\n+ outputHdlcOpen();\n+ outputHdlcWrite(SERFRAME_MOTE2PC_ACKREPLY);\n+ outputHdlcWrite(idmanager_getMyID(ADDR_16B)->addr_16b[0]);\n+ outputHdlcWrite(idmanager_getMyID(ADDR_16B)->addr_16b[1]);\n+ outputHdlcWrite(positiveAck);\n+ outputHdlcClose();\n+\n+ if (hasFrameFollowed){\n+ // there are frames following the ack,\n+ // the openserial_flush will be called when sending next frame.\n+ } else {\n+ // start TX'ing\n+ openserial_flush();\n+ }\n+\n+ return E_SUCCESS;\n+}\n+\nowerror_t openserial_print_uint32_t(uint32_t value) {\n#ifdef OPENSERIAL_PRINTF\nuint8_t i;\n@@ -571,20 +596,24 @@ void openserial_handleRxFrame() {\nswitch (cmdByte) {\ncase SERFRAME_PC2MOTE_SETROOT:\nidmanager_triggerAboutRoot();\n+ openserial_ackReply(TRUE,FALSE);\nbreak;\ncase SERFRAME_PC2MOTE_RESET:\nboard_reset();\nbreak;\ncase SERFRAME_PC2MOTE_DATA:\nopenbridge_triggerData();\n+ openserial_ackReply(TRUE,FALSE);\nbreak;\ncase SERFRAME_PC2MOTE_TRIGGERSERIALECHO:\n+ openserial_ackReply(TRUE,TRUE);\nopenserial_handleEcho(\n&openserial_vars.inputBuf[1],\nopenserial_vars.inputBufFillLevel-1\n);\nbreak;\ncase SERFRAME_PC2MOTE_COMMAND:\n+ openserial_ackReply(TRUE,FALSE);\nopenserial_handleCommands();\nbreak;\n}\n@@ -1060,6 +1089,10 @@ uint8_t isr_openserial_rx(void) {\nopenserial_vars.hdlcBusyReceiving = FALSE;\nif (openserial_vars.inputBufFillLevel==0){\n+\n+ // this is a negative ack and error message is following to sent\n+ openserial_ackReply(FALSE,TRUE);\n+\n// invalid HDLC frame\nopenserial_printError(\nCOMPONENT_OPENSERIAL,\n"
},
{
"change_type": "MODIFY",
"old_path": "drivers/common/openserial.h",
"new_path": "drivers/common/openserial.h",
"diff": "#define SERFRAME_MOTE2PC_CRITICAL ((uint8_t)'C')\n#define SERFRAME_MOTE2PC_SNIFFED_PACKET ((uint8_t)'P')\n#define SERFRAME_MOTE2PC_PRINTF ((uint8_t)'F')\n+#define SERFRAME_MOTE2PC_ACKREPLY ((uint8_t)'A')\n// frames sent PC->mote\n#define SERFRAME_PC2MOTE_SETROOT ((uint8_t)'R')\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-753. send an ACK to each received frame.
|
491,595 |
20.04.2018 14:34:28
| -7,200 |
30473cc28c430726b4fdabeb7a36205dbd880311
|
simplify the serial frame ACK.
|
[
{
"change_type": "MODIFY",
"old_path": "drivers/common/openserial.c",
"new_path": "drivers/common/openserial.c",
"diff": "@@ -47,10 +47,7 @@ owerror_t openserial_printInfoErrorCritical(\nerrorparameter_t arg1,\nerrorparameter_t arg2\n);\n-owerror_t openserial_ackReply(\n- bool positiveAck,\n- bool hasFrameFollowed\n-);\n+owerror_t openserial_ackReply(void);\n// command handlers\nvoid openserial_handleRxFrame(void);\n@@ -250,22 +247,16 @@ owerror_t openserial_printSniffedPacket(uint8_t* buffer, uint8_t length, uint8_t\n}\n-owerror_t openserial_ackReply(bool positiveAck, bool hasFrameFollowed) {\n+owerror_t openserial_ackReply(void) {\noutputHdlcOpen();\noutputHdlcWrite(SERFRAME_MOTE2PC_ACKREPLY);\noutputHdlcWrite(idmanager_getMyID(ADDR_16B)->addr_16b[0]);\noutputHdlcWrite(idmanager_getMyID(ADDR_16B)->addr_16b[1]);\n- outputHdlcWrite(positiveAck);\noutputHdlcClose();\n- if (hasFrameFollowed){\n- // there are frames following the ack,\n- // the openserial_flush will be called when sending next frame.\n- } else {\n// start TX'ing\nopenserial_flush();\n- }\nreturn E_SUCCESS;\n}\n@@ -596,24 +587,23 @@ void openserial_handleRxFrame() {\nswitch (cmdByte) {\ncase SERFRAME_PC2MOTE_SETROOT:\nidmanager_triggerAboutRoot();\n- openserial_ackReply(TRUE,FALSE);\n+ openserial_ackReply();\nbreak;\ncase SERFRAME_PC2MOTE_RESET:\nboard_reset();\nbreak;\ncase SERFRAME_PC2MOTE_DATA:\nopenbridge_triggerData();\n- openserial_ackReply(TRUE,FALSE);\n+ openserial_ackReply();\nbreak;\ncase SERFRAME_PC2MOTE_TRIGGERSERIALECHO:\n- openserial_ackReply(TRUE,TRUE);\nopenserial_handleEcho(\n&openserial_vars.inputBuf[1],\nopenserial_vars.inputBufFillLevel-1\n);\nbreak;\ncase SERFRAME_PC2MOTE_COMMAND:\n- openserial_ackReply(TRUE,FALSE);\n+ openserial_ackReply();\nopenserial_handleCommands();\nbreak;\n}\n@@ -1089,10 +1079,6 @@ uint8_t isr_openserial_rx(void) {\nopenserial_vars.hdlcBusyReceiving = FALSE;\nif (openserial_vars.inputBufFillLevel==0){\n-\n- // this is a negative ack and error message is following to sent\n- openserial_ackReply(FALSE,TRUE);\n-\n// invalid HDLC frame\nopenserial_printError(\nCOMPONENT_OPENSERIAL,\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-753. simplify the serial frame ACK.
|
491,595 |
20.04.2018 19:11:51
| -7,200 |
0e48c19500d39198512c3ed73b5d1cb284612294
|
stop serial "inhibit" after start of slot and end of frame interrupt. Start serial "inhibit" at start of frame interrupt. Schedule a timer to start "inhibit" SERIALINHIBITGUARD time before next slot.
|
[
{
"change_type": "MODIFY",
"old_path": "openstack/02a-MAClow/IEEE802154E.c",
"new_path": "openstack/02a-MAClow/IEEE802154E.c",
"diff": "@@ -65,8 +65,6 @@ void activity_rie6(void);\nvoid activity_ri9(PORT_TIMER_WIDTH capturedTime);\n// inhibit serial\nvoid activity_inhibitSerial(void);\n-void activity_handleSerial_start(void);\n-void activity_handleSerial_stop(void);\n// frame validity check\nbool isValidRxFrame(ieee802154_header_iht* ieee802514_header);\n@@ -381,10 +379,7 @@ void isr_ieee154e_timer(opentimers_id_t id) {\nactivity_inhibitSerial();\nbreak;\ncase S_SYNCLISTEN:\n- activity_handleSerial_start();\n- break;\n- case S_SYNCRXSERSTART:\n- activity_handleSerial_stop();\n+ activity_inhibitSerial();\nbreak;\ndefault:\n// log the error\n@@ -542,21 +537,11 @@ bool debugPrint_macStats(void) {\nport_INLINE void activity_synchronize_newSlot(void) {\n- openserial_inhibitStart();\n-\n// I'm in the middle of receiving a packet\nif (ieee154e_vars.state==S_SYNCRX) {\nreturn;\n}\n- opentimers_scheduleAbsolute(\n- ieee154e_vars.serialInhibitTimerId, // timerId\n- DURATION_si0, // duration\n- ieee154e_vars.startOfSlotReference, // reference\n- TIME_TICS, // timetype\n- isr_ieee154e_timer // callback\n- );\n-\nieee154e_vars.radioOnInit=sctimer_readCounter();\nieee154e_vars.radioOnThisSlot=TRUE;\n@@ -608,13 +593,23 @@ port_INLINE void activity_synchronize_newSlot(void) {\nif ( (ieee154e_vars.asn.bytes0and1&0x000f) ==0x0000) {\nopenserial_triggerDebugprint(); // FIXME: replace by task\n}\n+\n+ opentimers_scheduleAbsolute(\n+ ieee154e_vars.serialInhibitTimerId, // timerId\n+ DURATION_si, // duration\n+ ieee154e_vars.startOfSlotReference, // reference\n+ TIME_TICS, // timetype\n+ isr_ieee154e_timer // callback\n+ );\n+\n+ openserial_inhibitStop();\n}\nport_INLINE void activity_synchronize_startOfFrame(PORT_TIMER_WIDTH capturedTime) {\n// don't care about packet if I'm not listening\n// in case serial rx is started, we don't want to loss this packet because of wrong state machine, so capture the state here\n- if (ieee154e_vars.state!=S_SYNCLISTEN && ieee154e_vars.state!=S_SYNCRXSERSTART) {\n+ if (ieee154e_vars.state!=S_SYNCLISTEN) {\nreturn;\n}\n@@ -795,6 +790,8 @@ port_INLINE void activity_synchronize_endOfFrame(PORT_TIMER_WIDTH capturedTime)\n// return to listening state\nchangeState(S_SYNCLISTEN);\n+\n+ openserial_inhibitStop();\n}\nport_INLINE bool ieee154e_processIEs(OpenQueueEntry_t* pkt, uint16_t* lenIE) {\n@@ -2220,25 +2217,6 @@ port_INLINE void activity_inhibitSerial(void) {\nopenserial_inhibitStart(); // activity_inhibitSerial\n}\n-port_INLINE void activity_handleSerial_start(void){\n- changeState(S_SYNCRXSERSTART);\n-\n- openserial_inhibitStop(); // activity_inhibitSerial\n-\n- opentimers_scheduleAbsolute(\n- ieee154e_vars.serialInhibitTimerId, // timerId\n- DURATION_si1, // duration\n- ieee154e_vars.startOfSlotReference, // reference\n- TIME_TICS, // timetype\n- isr_ieee154e_timer // callback\n- );\n-}\n-\n-port_INLINE void activity_handleSerial_stop(void){\n- openserial_inhibitStart();\n- changeState(S_SYNCLISTEN);\n-}\n-\n//======= frame validity check\n/**\n@@ -2860,7 +2838,6 @@ void changeState(ieee154e_state_t newstate) {\nbreak;\ncase S_SLEEP:\ncase S_RXDATAOFFSET:\n- case S_SYNCRXSERSTART:\ndebugpins_fsm_clr();\nbreak;\ncase S_SYNCRX:\n@@ -2995,11 +2972,11 @@ void endSlot(void) {\n// change state\nchangeState(S_SLEEP);\n- // arm serialInhibit timer (if we are still BEFORE DURATION_si1)\n+ // arm serialInhibit timer (if we are still BEFORE DURATION_si)\nif (ieee154e_vars.isSync==TRUE) {\nopentimers_scheduleAbsolute(\nieee154e_vars.serialInhibitTimerId, // timerId\n- DURATION_si1, // duration\n+ DURATION_si, // duration\nieee154e_vars.startOfSlotReference, // reference\nTIME_TICS, // timetype\nisr_ieee154e_timer // callback\n@@ -3007,7 +2984,7 @@ void endSlot(void) {\n}\n// resume serial activity (if we are still BEFORE DURATION_si)\n- if (DURATION_si1+ieee154e_vars.startOfSlotReference-opentimers_getValue()<ieee154e_vars.slotDuration) {\n+ if (DURATION_si+ieee154e_vars.startOfSlotReference-opentimers_getValue()<ieee154e_vars.slotDuration) {\nopenserial_inhibitStop(); // end of slot\n}\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02a-MAClow/IEEE802154E.h",
"new_path": "openstack/02a-MAClow/IEEE802154E.h",
"diff": "@@ -147,7 +147,6 @@ typedef enum {\nS_TXACKDELAY = 0x17, // 'go' signal given, waiting for SFD Tx ACK\nS_TXACK = 0x18, // Tx ACK SFD received, sending bytes\nS_RXPROC = 0x19, // processing received data\n- S_SYNCRXSERSTART = 0x1a, // stop serial port activity\n} ieee154e_state_t;\n#define TIMESLOT_TEMPLATE_ID 0x00\n@@ -218,8 +217,7 @@ enum ieee154e_linkOption_enum {\n#define DURATION_rt7 ieee154e_vars.lastCapturedTime+TsTxAckDelay-delayTx+wdRadioTx\n#define DURATION_rt8 ieee154e_vars.lastCapturedTime+wdAckDuration\n// serialInhibit\n-#define DURATION_si0 ieee154e_vars.slotDuration-2*SERIALINHIBITGUARD\n-#define DURATION_si1 ieee154e_vars.slotDuration-SERIALINHIBITGUARD\n+#define DURATION_si ieee154e_vars.slotDuration-SERIALINHIBITGUARD\n//=========================== typedef =========================================\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-540. stop serial "inhibit" after start of slot and end of frame interrupt. Start serial "inhibit" at start of frame interrupt. Schedule a timer to start "inhibit" SERIALINHIBITGUARD time before next slot.
|
491,595 |
23.04.2018 09:10:16
| -7,200 |
23e1848d4471bd39fe0241090a37a08e4028fbed
|
change "timerSplited" to "splitTimer".
|
[
{
"change_type": "MODIFY",
"old_path": "drivers/common/opentimers.c",
"new_path": "drivers/common/opentimers.c",
"diff": "@@ -336,7 +336,7 @@ void opentimers_timer_callback(void){\nPORT_TIMER_WIDTH timerGap;\nPORT_TIMER_WIDTH tempTimerGap;\n- if (opentimers_vars.timerSplited==FALSE){\n+ if (opentimers_vars.splitTimer==FALSE){\nif (\nopentimers_vars.timersBuf[TIMER_INHIBIT].isrunning==TRUE &&\nopentimers_vars.currentCompareValue == opentimers_vars.timersBuf[TIMER_INHIBIT].currentCompareValue\n@@ -344,7 +344,7 @@ void opentimers_timer_callback(void){\nopentimers_vars.timersBuf[TIMER_INHIBIT].lastCompareValue = opentimers_vars.timersBuf[TIMER_INHIBIT].currentCompareValue;\nopentimers_vars.timersBuf[TIMER_INHIBIT].isrunning = FALSE;\nopentimers_vars.timersBuf[TIMER_INHIBIT].callback(TIMER_INHIBIT);\n- opentimers_vars.timerSplited = TRUE;\n+ opentimers_vars.splitTimer = TRUE;\n// the next timer selection will be done after SPLITE_TIMER_DURATION ticks\nsctimer_setCompare(sctimer_readCounter()+SPLITE_TIMER_DURATION);\nreturn;\n@@ -389,7 +389,7 @@ void opentimers_timer_callback(void){\n}\nopentimers_vars.lastCompareValue = opentimers_vars.currentCompareValue;\n} else {\n- opentimers_vars.timerSplited = FALSE;\n+ opentimers_vars.splitTimer = FALSE;\n}\n// find the next timer to be fired\n"
},
{
"change_type": "MODIFY",
"old_path": "drivers/common/opentimers.h",
"new_path": "drivers/common/opentimers.h",
"diff": "@@ -67,7 +67,7 @@ typedef struct {\nPORT_TIMER_WIDTH currentCompareValue;// current timeout, in ticks\nPORT_TIMER_WIDTH lastCompareValue; // last timeout, in ticks. This is the reference time to calculate the next to be expired timer.\nbool insideISR; // whether the function of opentimer is called inside of ISR or not\n- bool timerSplited;\n+ bool splitTimer; // indicate whether the previous opentimer callback is splitted.\n} opentimers_vars_t;\n//=========================== prototypes ======================================\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-540. change "timerSplited" to "splitTimer".
|
491,595 |
24.04.2018 11:25:50
| -7,200 |
674aa6b499c3b221d524f097e3965d589f5a8aa6
|
don't stop inhibit after endOfframe.
|
[
{
"change_type": "MODIFY",
"old_path": "openstack/02a-MAClow/IEEE802154E.c",
"new_path": "openstack/02a-MAClow/IEEE802154E.c",
"diff": "@@ -790,8 +790,6 @@ port_INLINE void activity_synchronize_endOfFrame(PORT_TIMER_WIDTH capturedTime)\n// return to listening state\nchangeState(S_SYNCLISTEN);\n-\n- openserial_inhibitStop();\n}\nport_INLINE bool ieee154e_processIEs(OpenQueueEntry_t* pkt, uint16_t* lenIE) {\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-540. don't stop inhibit after endOfframe.
|
491,595 |
24.04.2018 11:43:11
| -7,200 |
de65829cbc5ed018f6ec0c0e0e1bb432e51fd817
|
splitTimer flag is not needed.
|
[
{
"change_type": "MODIFY",
"old_path": "drivers/common/opentimers.c",
"new_path": "drivers/common/opentimers.c",
"diff": "@@ -336,7 +336,6 @@ void opentimers_timer_callback(void){\nPORT_TIMER_WIDTH timerGap;\nPORT_TIMER_WIDTH tempTimerGap;\n- if (opentimers_vars.splitTimer==FALSE){\nif (\nopentimers_vars.timersBuf[TIMER_INHIBIT].isrunning==TRUE &&\nopentimers_vars.currentCompareValue == opentimers_vars.timersBuf[TIMER_INHIBIT].currentCompareValue\n@@ -344,7 +343,6 @@ void opentimers_timer_callback(void){\nopentimers_vars.timersBuf[TIMER_INHIBIT].lastCompareValue = opentimers_vars.timersBuf[TIMER_INHIBIT].currentCompareValue;\nopentimers_vars.timersBuf[TIMER_INHIBIT].isrunning = FALSE;\nopentimers_vars.timersBuf[TIMER_INHIBIT].callback(TIMER_INHIBIT);\n- opentimers_vars.splitTimer = TRUE;\n// the next timer selection will be done after SPLITE_TIMER_DURATION ticks\nsctimer_setCompare(sctimer_readCounter()+SPLITE_TIMER_DURATION);\nreturn;\n@@ -388,9 +386,6 @@ void opentimers_timer_callback(void){\n}\n}\nopentimers_vars.lastCompareValue = opentimers_vars.currentCompareValue;\n- } else {\n- opentimers_vars.splitTimer = FALSE;\n- }\n// find the next timer to be fired\ni = 0;\n"
},
{
"change_type": "MODIFY",
"old_path": "drivers/common/opentimers.h",
"new_path": "drivers/common/opentimers.h",
"diff": "@@ -67,7 +67,6 @@ typedef struct {\nPORT_TIMER_WIDTH currentCompareValue;// current timeout, in ticks\nPORT_TIMER_WIDTH lastCompareValue; // last timeout, in ticks. This is the reference time to calculate the next to be expired timer.\nbool insideISR; // whether the function of opentimer is called inside of ISR or not\n- bool splitTimer; // indicate whether the previous opentimer callback is splitted.\n} opentimers_vars_t;\n//=========================== prototypes ======================================\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-540. splitTimer flag is not needed.
|
491,605 |
24.04.2018 13:40:19
| -7,200 |
cc5a0c30c7a3e62b261cf810e9aa067c012db70a
|
Added nrf52840dk as possible target.
|
[
{
"change_type": "MODIFY",
"old_path": "SConscript",
"new_path": "SConscript",
"diff": "@@ -197,7 +197,7 @@ elif env['toolchain']=='iar-proj':\nelif env['toolchain']=='armgcc':\n- if env['board'] not in ['silabs-ezr32wg','openmote-cc2538','openmote-b','iot-lab_M3','iot-lab_A8-M3','openmotestm', 'samr21_xpro']:\n+ if env['board'] not in ['silabs-ezr32wg','openmote-cc2538','openmote-b','iot-lab_M3','iot-lab_A8-M3','openmotestm','samr21_xpro','nrf52840dk']:\nraise SystemError('toolchain {0} can not be used for board {1}'.format(env['toolchain'],env['board']))\nif env['board'] in ['openmote-cc2538','openmote-b']:\n@@ -391,6 +391,85 @@ elif env['toolchain']=='armgcc':\nenv.Replace(NM = 'arm-none-eabi-nm')\nenv.Replace(SIZE = 'arm-none-eabi-size')\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+ elif env['board']=='nrf52840dk':\n+ # compiler (C)\n+ env.Replace(CC = 'arm-none-eabi-gcc')\n+ env.Append(CCFLAGS = '-O0')\n+ env.Append(CCFLAGS = '-Wall')\n+ env.Append(CCFLAGS = '-Wa,-adhlns=${TARGET.base}.lst')\n+ env.Append(CCFLAGS = '-c')\n+ env.Append(CCFLAGS = '-fmessage-length=0')\n+ env.Append(CCFLAGS = '-mcpu=cortex-m4')\n+ env.Append(CCFLAGS = '-mthumb')\n+ env.Append(CCFLAGS = '-g')\n+ env.Append(CCFLAGS = '-std=gnu99')\n+ env.Append(CCFLAGS = '-O0')\n+ env.Append(CCFLAGS = '-Wall')\n+ env.Append(CCFLAGS = '-Wstrict-prototypes')\n+ env.Append(CCFLAGS = '-ffunction-sections')\n+ env.Append(CCFLAGS = '-fdata-sections')\n+ env.Append(CCFLAGS = '-mfpu=fpv4-sp-d16')\n+ env.Append(CCFLAGS = '-mfloat-abi=softfp')\n+ env.Append(CCFLAGS = '-DNRF52840_XXAA=1')\n+\n+ # assembler\n+ env.Replace(AS = 'arm-none-eabi-as')\n+ env.Append(ASFLAGS = '-g -gdwarf-2 -mcpu=cortex-m4 -mthumb -c -x assembler-with-cpp ')\n+ env.Append(ASFLAGS = '-DNRF52840_XXAA=1')\n+\n+ # linker\n+ env.Append(LINKFLAGS = '-g -gdwarf-2 -mcpu=cortex-m4 -mthumb -Tbsp/boards/nrf52840dk/nrfx/mdk/nrf52840_xxaa.ld')\n+ env.Append(LINKFLAGS = '-Xlinker --gc-sections -Xlinker')\n+ env.Append(LINKFLAGS = '-Map=${TARGET.base}.map')\n+\n+ env.Append(LINKFLAGS = '-mfpu=fpv4-sp-d16 -mfloat-abi=softfp --specs=nosys.specs')\n+ #--specs=nano.specs\n+ #env.Append(LINKFLAGS = '-lgcc -lc -lnosys')\n+ env.Append(LINKFLAGS = '-Wl,--start-group -lgcc -lc -lg -lm -lnosys -Wl,--end-group')\n+\n+ # object manipulation\n+ env.Replace(OBJCOPY = 'arm-none-eabi-objcopy')\n+ env.Replace(OBJDUMP = 'arm-none-eabi-objdump')\n+ # archiver\n+ env.Replace(AR = 'arm-none-eabi-ar')\n+ env.Append(ARFLAGS = '')\n+ env.Replace(RANLIB = 'arm-none-eabi-ranlib')\n+ env.Append(RANLIBFLAGS = '')\n+ # misc\n+ env.Replace(NM = 'arm-none-eabi-nm')\n+ env.Replace(SIZE = 'arm-none-eabi-size')\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\nelse:\nraise SystemError('unexpected board={0}'.format(env['board']))\n"
},
{
"change_type": "MODIFY",
"old_path": "SConstruct",
"new_path": "SConstruct",
"diff": "@@ -37,7 +37,7 @@ project:\nboard Board to build for. 'python' is for software simulation.\ntelosb, wsn430v14, wsn430v13b, gina, z1, python,\n- iot-lab_M3, iot-lab_A8-M3\n+ iot-lab_M3, iot-lab_A8-M3, nrf52840dk\nversion Board version\n@@ -115,6 +115,8 @@ command_line_options = {\n'iot-lab_A8-M3',\n'agilefox',\n'samr21_xpro',\n+ # Cortex-M4\n+ 'nrf52840dk',\n# misc.\n'python',\n],\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
Added nrf52840dk as possible target.
|
491,587 |
26.04.2018 02:27:52
| -7,200 |
a9672878812d5259f25d33f7a5459fc81186f9a2
|
Calculating wrong frequencies when NUM_CHANNELS differs from 16
Quick fix for calculating the correct asnOffset.
|
[
{
"change_type": "MODIFY",
"old_path": "openstack/02a-MAClow/IEEE802154E.c",
"new_path": "openstack/02a-MAClow/IEEE802154E.c",
"diff": "@@ -2275,7 +2275,7 @@ port_INLINE void incrementAsnOffset(void) {\n} else {\nieee154e_vars.slotOffset = (ieee154e_vars.slotOffset+1)%frameLength;\n}\n- ieee154e_vars.asnOffset = (ieee154e_vars.asnOffset+1)%16;\n+ ieee154e_vars.asnOffset = (ieee154e_vars.asnOffset+1)% NUM_CHANNELS;\n}\nport_INLINE void ieee154e_resetAsn(void) {\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-757: Calculating wrong frequencies when NUM_CHANNELS differs from 16
Quick fix for calculating the correct asnOffset.
|
491,595 |
27.04.2018 14:12:09
| -7,200 |
716fa68b741881e04bfe4ec011d230a0d7319da9
|
execute debug printing in task mode.
|
[
{
"change_type": "MODIFY",
"old_path": "drivers/common/openserial.c",
"new_path": "drivers/common/openserial.c",
"diff": "@@ -310,7 +310,7 @@ owerror_t openserial_print_str(char* buffer, uint8_t length) {\n//===== retrieving inputBuffer\n-void openserial_triggerDebugprint() {\n+void task_openserial_debugPrint(void) {\nuint8_t debugPrintCounter;\nINTERRUPT_DECLARATION();\n@@ -323,7 +323,6 @@ void openserial_triggerDebugprint() {\nif (openserial_vars.outputBufIdxW!=openserial_vars.outputBufIdxR) {\nreturn;\n}\n- // FIX: remove when openserial_triggerDebugprint called in a task...\ndebugPrintCounter++;\nif (debugPrintCounter==STATUS_MAX) {\n"
},
{
"change_type": "MODIFY",
"old_path": "drivers/common/openserial.h",
"new_path": "drivers/common/openserial.h",
"diff": "@@ -154,7 +154,9 @@ owerror_t openserial_printSniffedPacket(\nuint8_t length,\nuint8_t channel\n);\n-void openserial_triggerDebugprint(void);\n+\n+void task_openserial_debugPrint(void);\n+\nowerror_t openserial_print_str(char* buffer, uint8_t length);\nowerror_t openserial_print_uint32_t(uint32_t value);\n"
},
{
"change_type": "MODIFY",
"old_path": "kernel/scheduler.h",
"new_path": "kernel/scheduler.h",
"diff": "@@ -28,7 +28,8 @@ typedef enum {\nTASKPRIO_BUTTON = 0x09,\nTASKPRIO_SIXTOP_TIMEOUT = 0x0a,\nTASKPRIO_SNIFFER = 0x0b,\n- TASKPRIO_MAX = 0x0c,\n+ TASKPRIO_OPENSERIAL = 0X0c,\n+ TASKPRIO_MAX = 0x0d,\n} task_prio_t;\n#define TASK_LIST_DEPTH 10\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02a-MAClow/IEEE802154E.c",
"new_path": "openstack/02a-MAClow/IEEE802154E.c",
"diff": "@@ -591,7 +591,7 @@ port_INLINE void activity_synchronize_newSlot(void) {\n// increment dummy ASN to trigger debugprint every now and then\nieee154e_vars.asn.bytes0and1++;\nif ( (ieee154e_vars.asn.bytes0and1&0x000f) ==0x0000) {\n- openserial_triggerDebugprint(); // FIXME: replace by task\n+ scheduler_push_task(task_openserial_debugPrint,TASKPRIO_OPENSERIAL);\n}\nopentimers_scheduleAbsolute(\n@@ -914,7 +914,7 @@ port_INLINE void activity_ti1ORri1(void) {\n// this is NOT the next active slot, abort\n// trigger debug prints\n- openserial_triggerDebugprint(); // FIXME: replace by task\n+ scheduler_push_task(task_openserial_debugPrint,TASKPRIO_OPENSERIAL);\n// abort the slot\nendSlot();\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/python/SConscript.env",
"new_path": "projects/python/SConscript.env",
"diff": "@@ -404,11 +404,11 @@ functionsToChange = [\n'openserial_printInfoErrorCritical',\n'openserial_printData',\n'openserial_printSniffedPacket',\n- 'openserial_triggerDebugprint',\n'openserial_printInfo',\n'openserial_printError',\n'openserial_printCritical',\n'openserial_ackReply',\n+ 'task_openserial_debugPrint',\n'openserial_print_str',\n'openserial_print_uint32_t',\n'openserial_board_reset_cb',\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-540. execute debug printing in task mode.
|
491,595 |
27.04.2018 14:36:01
| -7,200 |
22e1d1899ed17060607f770bf7a818fcde94934d
|
update sniffer project.
|
[
{
"change_type": "MODIFY",
"old_path": "projects/common/03oos_sniffer/03oos_sniffer.c",
"new_path": "projects/common/03oos_sniffer/03oos_sniffer.c",
"diff": "@@ -162,7 +162,7 @@ void cb_timer(opentimers_id_t id) {\ncb_timer // callback\n);\napp_vars.outputOrInput = (app_vars.outputOrInput+1)%2;\n- openserial_triggerDebugprint(); // FIXME: replace by task\n+ scheduler_push_task(task_openserial_debugPrint,TASKPRIO_OPENSERIAL);\n}\n// ================================ task =======================================\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-540. update sniffer project.
|
491,605 |
27.04.2018 15:33:29
| -7,200 |
0e6122422b45b005f4c6a787cdf9eaef34a13807
|
leds, debugpins, and uart ported.
Next todos:
port timers,
revert changes in sdk/config/nrf*/config/sdk_config.h and make relevant defines in board_info.h or per compiler flag in SConscript
remove irrelevant parts of the SDK
|
[
{
"change_type": "ADD",
"old_path": null,
"new_path": ".vscode/c_cpp_properties.json",
"diff": "+{\n+ \"configurations\": [\n+ {\n+ \"name\": \"Mac\",\n+ \"includePath\": [\n+ \"/usr/include\",\n+ \"/usr/local/include\",\n+ \"${workspaceFolder}\"\n+ ],\n+ \"defines\": [],\n+ \"intelliSenseMode\": \"clang-x64\",\n+ \"browse\": {\n+ \"path\": [\n+ \"/usr/include\",\n+ \"/usr/local/include\",\n+ \"${workspaceFolder}\"\n+ ],\n+ \"limitSymbolsToIncludedHeaders\": true,\n+ \"databaseFilename\": \"\"\n+ },\n+ \"macFrameworkPath\": [\n+ \"/System/Library/Frameworks\",\n+ \"/Library/Frameworks\"\n+ ]\n+ },\n+ {\n+ \"name\": \"Linux\",\n+ \"includePath\": [\n+ \"/usr/include\",\n+ \"/usr/local/include\",\n+ \"${workspaceFolder}\"\n+ ],\n+ \"defines\": [],\n+ \"intelliSenseMode\": \"clang-x64\",\n+ \"browse\": {\n+ \"path\": [\n+ \"/usr/include\",\n+ \"/usr/local/include\",\n+ \"${workspaceFolder}\"\n+ ],\n+ \"limitSymbolsToIncludedHeaders\": true,\n+ \"databaseFilename\": \"\"\n+ }\n+ },\n+ {\n+ \"name\": \"Win32\",\n+ \"includePath\": [\n+ \"${workspaceFolder}/bsp/boards/nrf52840dk/sdk/modules/nrfx\",\n+ \"${workspaceFolder}/bsp/boards/nrf52840dk/sdk/components/toolchain/cmsis/include\",\n+ \"${workspaceFolder}/bsp/boards/nrf52840dk/sdk/integration/nrfx\",\n+ \"${workspaceFolder}/bsp/boards/nrf52840dk/sdk/modules/nrfx/hal\",\n+ \"${workspaceFolder}/bsp/boards/nrf52840dk/sdk/config/nrf52840/config\",\n+ \"${workspaceFolder}/bsp/boards/nrf52840dk/sdk/components/libraries/util\",\n+ \"${workspaceFolder}/bsp/boards/nrf52840dk/sdk/components/libraries/uart\"\n+ ],\n+ \"defines\": [\n+ \"_DEBUG\",\n+ \"UNICODE\",\n+ \"_UNICODE\"\n+ ],\n+ \"intelliSenseMode\": \"msvc-x64\",\n+ \"browse\": {\n+ \"path\": [\n+ \"${workspaceFolder}\"\n+ ],\n+ \"limitSymbolsToIncludedHeaders\": true,\n+ \"databaseFilename\": \"\"\n+ },\n+ \"cStandard\": \"c11\",\n+ \"cppStandard\": \"c++17\"\n+ }\n+ ],\n+ \"version\": 3\n+}\n\\ No newline at end of file\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": ".vscode/settings.json",
"diff": "+{\n+ \"files.associations\": {\n+ \"nrfx_clock.h\": \"c\",\n+ \"nrf52840.h\": \"c\",\n+ \"nrf_pwr_mgmt.h\": \"c\",\n+ \"app_uart.h\": \"c\"\n+ }\n+}\n\\ No newline at end of file\n"
},
{
"change_type": "MODIFY",
"old_path": "SConscript",
"new_path": "SConscript",
"diff": "@@ -407,6 +407,9 @@ elif env['toolchain']=='armgcc':\nelif env['board']=='nrf52840dk':\n+\n+ # @note: a few changes have been made to the sdk config file[s], these need to be removed and the corresponding defines be made here!\n+\n# compiler (C)\nenv.Replace(CC = 'arm-none-eabi-gcc')\nenv.Append(CCFLAGS = '-O0')\n@@ -418,16 +421,15 @@ elif env['toolchain']=='armgcc':\nenv.Append(CCFLAGS = '-mthumb')\nenv.Append(CCFLAGS = '-g')\nenv.Append(CCFLAGS = '-std=gnu99')\n- env.Append(CCFLAGS = '-O0')\n- env.Append(CCFLAGS = '-Wall')\nenv.Append(CCFLAGS = '-Wstrict-prototypes')\nenv.Append(CCFLAGS = '-ffunction-sections')\nenv.Append(CCFLAGS = '-fdata-sections')\nenv.Append(CCFLAGS = '-mfpu=fpv4-sp-d16')\nenv.Append(CCFLAGS = '-mfloat-abi=softfp')\n- env.Append(CCFLAGS = '-DNRF52840_XXAA=1')\nenv.Append(CCFLAGS = '-D__FPU_PRESENT=1')\n-# env.Append(CCFLAGS = os.path.join('bsp','boards',env['board'],'sdk','modules','nrfx','mdk','gcc_startup_nrf52840.S'))\n+ env.Append(CCFLAGS = '-D__FPU_PRESENT=1')\n+ env.Append(CCFLAGS = '-DNRF52840_XXAA=1') # set the CPU to nRF52840 (ARM Cortex M4f)\n+ env.Append(CCFLAGS = '-DBOARD_PCA10056=1') # set the board to be the nRF52840 Development Kit\n# assembler\nenv.Replace(AS = 'arm-none-eabi-as')\n@@ -436,13 +438,20 @@ elif env['toolchain']=='armgcc':\n# linker\nenv.Append(LINKFLAGS = '-Lbsp/boards/nrf52840dk/sdk/modules/nrfx/mdk')\n- env.Append(LINKFLAGS = '-g -gdwarf-2 -mcpu=cortex-m4 -mthumb -Tbsp/boards/nrf52840dk/nrf52840_xxaa.ld')\n+ env.Append(LINKFLAGS = '-g -gdwarf-2 -mcpu=cortex-m4 -mthumb')\n+\n+ # @todo: Decide which linker script to use\n+ # env.Append(LINKFLAGS = '-Tbsp/boards/nrf52840dk/nrf52840_xxaa.ld')\n+ env.Append(LINKFLAGS = '-Tbsp/boards/nrf52840dk/sdk/config/nrf52840/armgcc/generic_gcc_nrf52.ld')\n+\n+ # env.Append(LINKFLAGS = '--strip-debug')\n+\nenv.Append(LINKFLAGS = '-Xlinker --gc-sections -Xlinker')\nenv.Append(LINKFLAGS = '-Map=${TARGET.base}.map')\nenv.Append(LINKFLAGS = '-mfpu=fpv4-sp-d16 -mfloat-abi=softfp --specs=nosys.specs')\n+\n#--specs=nano.specs\n- #env.Append(LINKFLAGS = '-lgcc -lc -lnosys')\nenv.Append(LINKFLAGS = '-Wl,--start-group -lgcc -lc -lg -lm -lnosys -Wl,--end-group')\nenv.Append(LINKFLAGS = os.path.join('build',env['board']+'_armgcc','bsp','boards',env['board'],'sdk','modules','nrfx','mdk','gcc_startup_nrf52840.o'))\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/nrf52840dk/SConscript",
"new_path": "bsp/boards/nrf52840dk/SConscript",
"diff": "@@ -11,14 +11,28 @@ localEnv = env.Clone()\nsource = \\\nGlob('sdk/modules/nrfx/mdk/gcc_startup_nrf52840.S') + \\\nGlob('sdk/modules/nrfx/mdk/system_nrf52840.c') + \\\n+ Glob('sdk/components/boards/boards.c') + \\\n+ Glob('sdk/modules/nrfx/drivers/src/nrfx_clock.c') + \\\n+ Glob('sdk/modules/nrfx/drivers/src/nrfx_power.c') + \\\n+ Glob('sdk/components/libraries/experimental_section_vars/*.c') + \\\n+ Glob('sdk/components/libraries/pwr_mgmt/*.c') + \\\n+ Glob('sdk/components/libraries/uart/*.c') + \\\nGlob('*.c')\nlocalEnv.Append(\nCPPPATH = [\nos.path.join('#','bsp','boards','nrf52840dk'),\n+ os.path.join('#','bsp','boards','nrf52840dk','sdk','config','nrf52840','config'),\nos.path.join('#','bsp','boards','nrf52840dk','sdk','integration','nrfx'),\nos.path.join('#','bsp','boards','nrf52840dk','sdk','components','toolchain','cmsis','include'),\nos.path.join('#','bsp','boards','nrf52840dk','sdk','components','drivers_nrf','nrf_soc_nosd'),\n+ os.path.join('#','bsp','boards','nrf52840dk','sdk','components','libraries','atomic'),\n+ os.path.join('#','bsp','boards','nrf52840dk','sdk','components','libraries','balloc'),\n+ os.path.join('#','bsp','boards','nrf52840dk','sdk','components','libraries','experimental_log'),\n+ os.path.join('#','bsp','boards','nrf52840dk','sdk','components','libraries','experimental_log','src'),\n+ os.path.join('#','bsp','boards','nrf52840dk','sdk','components','libraries','experimental_memobj'),\n+ os.path.join('#','bsp','boards','nrf52840dk','sdk','components','libraries','experimental_section_vars'),\n+ os.path.join('#','bsp','boards','nrf52840dk','sdk','components','libraries','mutex'),\nos.path.join('#','bsp','boards','nrf52840dk','sdk','components','libraries','util'),\nos.path.join('#','bsp','boards','nrf52840dk','sdk','modules','nrfx'),\nos.path.join('#','bsp','boards','nrf52840dk','sdk','modules','nrfx','drivers'),\n@@ -29,7 +43,7 @@ localEnv.Append(\nos.path.join('#','bsp','boards','nrf52840dk','sdk','modules','nrfx','mdk'),\nos.path.join('#','bsp','boards','nrf52840dk','sdk','modules','nrfx','soc'),\nos.path.join('#','bsp','boards','nrf52840dk','sdk','modules','nrfx','templates'),\n- os.path.join('#','bsp','boards','nrf52840dk','sdk','modules','nrfx','templates','nRF52840'),\n+# os.path.join('#','bsp','boards','nrf52840dk','sdk','modules','nrfx','templates','nRF52840'),\n],\n)\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/nrf52840dk/board.c",
"new_path": "bsp/boards/nrf52840dk/board.c",
"diff": "*/\n+#include \"sdk/modules/nrfx/hal/nrf_power.h\"\n+#include \"sdk/modules/nrfx/drivers/include/nrfx_clock.h\"\n+#include \"sdk/components/libraries/pwr_mgmt/nrf_pwr_mgmt.h\"\n+\n#include \"sdk/modules/nrfx/mdk/nrf52840.h\"\n#include \"sdk/modules/nrfx/drivers/nrfx_common.h\"\n#include \"sdk/components/libraries/util/nrf_assert.h\"\n-#include \"sdk/integration/nrfx/nrfx_glue.h\"\n#include \"sdk/components/toolchain/cmsis/include/core_cm4.h\"\n+#include \"sdk/integration/nrfx/nrfx_glue.h\"\n+#include \"sdk/components/boards/boards.h\"\n#include \"board.h\"\n#include \"leds.h\"\n#include \"debugpins.h\"\n#include \"uart.h\"\n#include \"radio.h\"\n-// #include \"em_cmu.h\"\n-// #include \"em_chip.h\"\n-// #include \"em_emu.h\"\n#include \"spi.h\"\n//=========================== variables =======================================\n//=========================== prototypes ======================================\nstatic void button_init(void);\n-\n+static void clock_event_handler(nrfx_clock_evt_type_t event);\n//=========================== main ============================================\nextern int mote_main(void);\n-int main(void) {\n+int main(void)\n+{\nreturn mote_main();\n}\n@@ -43,29 +46,65 @@ int main(void) {\nvoid board_init(void)\n{\n-// CHIP_Init();\n+ // start low-frequency clock (LFCLK)\n+ nrfx_clock_init(clock_event_handler);\n+ nrfx_clock_lfclk_start();\n+\n+ // put low-frequency clock into ultra low power (ULP) mode (will NOT work on the older nRF52832)\n+ NRF_CLOCK->LFRCMODE= (CLOCK_LFRCMODE_MODE_ULP & CLOCK_LFRCMODE_MODE_Msk) << CLOCK_LFRCMODE_MODE_Pos;\n+\n+ // enable on-board DC-DC converter to reduce overall consumption (this also disables the LDO [low-dropout] regulator)\n+ // This only works if the required coil and condenser are properly connected to the pins DCC and DEC4, which is the\n+ // case with the development kit, but not with some other nRF52840-based boards. (If enabled without the proper\n+ // circuitry, the CPU will hang.)\n+ nrf_power_dcdcen_set(true);\n+\n+ // start high frequency clock (HFCLK) ///< @todo: Revise, whether it is really needed.\n+ nrfx_clock_hfclk_start();\n- leds_init();\n- debugpins_init();\n- button_init();\n+ // initialize power management library\n+ nrf_pwr_mgmt_init();\n+\n+ // initialize boards with LEDs and buttons\n+ bsp_board_init(BSP_INIT_LEDS | BSP_INIT_BUTTONS);\n+\n+// button_init();\n+// debugpins_init();\n// bsp_timer_init();\n// radiotimer_init();\n- uart_init();\n- radio_init();\n+// uart_init();\n+// radio_init();\n// spi_init();\n}\n/**\n* Puts the board to sleep\n*/\n-void board_sleep(void) {\n- //EMU_EnterEM1();\n+void board_sleep(void)\n+{\n+ nrf_pwr_mgmt_run();\n+\n+/* @note: Below code could be an alternative without using the power management library\n+\n+ // power management command (waiting for the next NVIC event)\n+ #ifdef __GNUC__\n+ static void __INLINE cpu_wfe(void)\n+ #else\n+ static void __forceinline cpu_wfe(void)\n+ #endif\n+ {\n+ __WFE();\n+ __SEV();\n+ __WFE();\n+ }\n+*/\n}\n/**\n* Resets the board\n*/\n-void board_reset(void) {\n+void board_reset(void)\n+{\nNVIC_SystemReset();\n}\n@@ -76,8 +115,32 @@ void board_reset(void) {\n/**\n* Configures the user button as input source\n*/\n-static void button_init(void) {\n-\n+static void button_init(void)\n+{\n}\n+\n//=========================== interrupt handlers ==============================\n+static void clock_event_handler(nrfx_clock_evt_type_t event)\n+{\n+ switch(event)\n+ {\n+ case NRFX_CLOCK_EVT_HFCLK_STARTED: ///< HFCLK has been started\n+ // ...\n+ break;\n+\n+ case NRFX_CLOCK_EVT_LFCLK_STARTED: ///< LFCLK has been started\n+ // ...\n+ break;\n+\n+ case NRFX_CLOCK_EVT_CTTO: ///< Calibration timeout\n+ // ...\n+ break;\n+\n+ case NRFX_CLOCK_EVT_CAL_DONE: ///< Calibration has been done\n+ // ...\n+ break;\n+\n+\n+ }\n+}\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "bsp/boards/nrf52840dk/debugpins.c",
"diff": "+ /**\n+ * Author: Tamas Harczos (tamas.harczos@imms.de)\n+ * Date: Apr 2018\n+ * Description: nRF52840-specific definition of the \"debugpins\" bsp module.\n+ */\n+\n+#include \"sdk/modules/nrfx/hal/nrf_gpio.h\"\n+\n+#include \"debugpins.h\"\n+#include \"stdint.h\"\n+#include \"board.h\"\n+#include \"board_info.h\"\n+\n+\n+\n+//=========================== defines =========================================\n+\n+// board debug PINS defines (Note that all of them are from port 0, i.e., 0.26, 0.27, etc. This is assumed in the below functions.)\n+#define GPIO_DEBUGPIN_FRAME 26\n+#define GPIO_DEBUGPIN_SLOT 27\n+#define GPIO_DEBUGPIN_FSM 28\n+#define GPIO_DEBUGPIN_TASK 29\n+#define GPIO_DEBUGPIN_ISR 30\n+#define GPIO_DEBUGPIN_RADIO 31\n+\n+// the below defines are used to cycle through all pins\n+#define GPIO_NUM_DEBUGPINS 6\n+#define GPIO_PINS_LIST { GPIO_DEBUGPIN_SLOT, GPIO_DEBUGPIN_FRAME, GPIO_DEBUGPIN_ISR, GPIO_DEBUGPIN_TASK, GPIO_DEBUGPIN_FSM, GPIO_DEBUGPIN_RADIO }\n+\n+//=========================== variables =======================================\n+\n+//=========================== prototypes ======================================\n+\n+//=========================== public ==========================================\n+\n+void debugpins_init(void)\n+{\n+ // set the corresponding GPIO pins to be used as output\n+ const uint8_t m_board_gpio_debugpin_list[GPIO_NUM_DEBUGPINS] = GPIO_PINS_LIST;\n+\n+ for (uint8_t p=0; p < GPIO_NUM_DEBUGPINS; ++p)\n+ {\n+ nrf_gpio_cfg(\n+ NRF_GPIO_PIN_MAP(0, m_board_gpio_debugpin_list[p]),\n+ NRF_GPIO_PIN_DIR_OUTPUT,\n+ NRF_GPIO_PIN_INPUT_DISCONNECT,\n+ NRF_GPIO_PIN_NOPULL,\n+ NRF_GPIO_PIN_S0S1,\n+ NRF_GPIO_PIN_NOSENSE);\n+ }\n+}\n+\n+\n+void debugpins_frame_set(void)\n+{\n+ nrf_gpio_pin_set(NRF_GPIO_PIN_MAP(0, GPIO_DEBUGPIN_FRAME));\n+}\n+\n+void debugpins_frame_clr(void)\n+{\n+ nrf_gpio_pin_clear(NRF_GPIO_PIN_MAP(0, GPIO_DEBUGPIN_FRAME));\n+}\n+\n+void debugpins_frame_toggle(void)\n+{\n+ nrf_gpio_pin_toggle(NRF_GPIO_PIN_MAP(0, GPIO_DEBUGPIN_FRAME));\n+}\n+\n+\n+void debugpins_slot_set(void)\n+{\n+ nrf_gpio_pin_set(NRF_GPIO_PIN_MAP(0, GPIO_DEBUGPIN_SLOT));\n+}\n+\n+void debugpins_slot_clr(void)\n+{\n+ nrf_gpio_pin_clear(NRF_GPIO_PIN_MAP(0, GPIO_DEBUGPIN_SLOT));\n+}\n+\n+void debugpins_slot_toggle(void)\n+{\n+ nrf_gpio_pin_toggle(NRF_GPIO_PIN_MAP(0, GPIO_DEBUGPIN_SLOT));\n+}\n+\n+\n+void debugpins_fsm_set(void)\n+{\n+ nrf_gpio_pin_set(NRF_GPIO_PIN_MAP(0, GPIO_DEBUGPIN_FSM));\n+}\n+\n+void debugpins_fsm_clr(void)\n+{\n+ nrf_gpio_pin_clear(NRF_GPIO_PIN_MAP(0, GPIO_DEBUGPIN_FSM));\n+}\n+\n+void debugpins_fsm_toggle(void)\n+{\n+ nrf_gpio_pin_toggle(NRF_GPIO_PIN_MAP(0, GPIO_DEBUGPIN_FSM));\n+}\n+\n+\n+void debugpins_task_set(void)\n+{\n+ nrf_gpio_pin_set(NRF_GPIO_PIN_MAP(0, GPIO_DEBUGPIN_TASK));\n+}\n+\n+void debugpins_task_clr(void)\n+{\n+ nrf_gpio_pin_clear(NRF_GPIO_PIN_MAP(0, GPIO_DEBUGPIN_TASK));\n+}\n+\n+void debugpins_task_toggle(void)\n+{\n+ nrf_gpio_pin_toggle(NRF_GPIO_PIN_MAP(0, GPIO_DEBUGPIN_TASK));\n+}\n+\n+\n+void debugpins_isr_set(void)\n+{\n+ nrf_gpio_pin_set(NRF_GPIO_PIN_MAP(0, GPIO_DEBUGPIN_ISR));\n+}\n+\n+void debugpins_isr_clr(void)\n+{\n+ nrf_gpio_pin_clear(NRF_GPIO_PIN_MAP(0, GPIO_DEBUGPIN_ISR));\n+}\n+\n+void debugpins_isr_toggle(void)\n+{\n+ nrf_gpio_pin_toggle(NRF_GPIO_PIN_MAP(0, GPIO_DEBUGPIN_ISR));\n+}\n+\n+\n+void debugpins_radio_set(void)\n+{\n+ nrf_gpio_pin_set(NRF_GPIO_PIN_MAP(0, GPIO_DEBUGPIN_RADIO));\n+}\n+\n+void debugpins_radio_clr(void)\n+{\n+ nrf_gpio_pin_clear(NRF_GPIO_PIN_MAP(0, GPIO_DEBUGPIN_RADIO));\n+}\n+\n+void debugpins_radio_toggle(void)\n+{\n+ nrf_gpio_pin_toggle(NRF_GPIO_PIN_MAP(0, GPIO_DEBUGPIN_RADIO));\n+}\n+\n+\n+//------------ private ------------//\n+\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/nrf52840dk/leds.c",
"new_path": "bsp/boards/nrf52840dk/leds.c",
"diff": "* Description: nRF52840-specific definition of the \"leds\" bsp module.\n*/\n+#include \"sdk/components/boards/pca10056.h\"\n+#include \"sdk/components/boards/boards.h\"\n+#include \"sdk/components/libraries/delay/nrf_delay.h\"\n+\n#include \"stdint.h\"\n#include \"leds.h\"\n#include \"board.h\"\n#include \"board_info.h\"\n-/*\n+\n//=========================== defines =========================================\n-#define LEDS_PORT_ERROR 6\n-#define LEDS_PORT_DEBUG 6\n-#define LEDS_PORT_SYNC 7\n-#define LEDS_PORT_RADIO 7\n+#define LED_IDX_ERROR 0\n+#define LED_IDX_DEBUG 1\n+#define LED_IDX_SYNC 2\n+#define LED_IDX_RADIO 3\n//=========================== variables =======================================\n//=========================== public ==========================================\n-void leds_init(void)\n+void leds_init()\n{\n- //enable clock for this peripheral\n- CMU_ClockEnable(cmuClock_HFPER, TRUE);\n- CMU_ClockEnable(cmuClock_GPIO, TRUE);\n+ // LEDs have probably been already initialized in board.c:board_init(), but we can do that again without problems\n- //set the led pins to output.\n- GPIO_PinModeSet(gpioPortF, LEDS_PORT_ERROR, gpioModePushPull, 0);\n- GPIO_PinModeSet(gpioPortF, LEDS_PORT_DEBUG, gpioModePushPull, 0);\n- GPIO_PinModeSet(gpioPortF, LEDS_PORT_SYNC, gpioModePushPull, 0);\n- GPIO_PinModeSet(gpioPortF, LEDS_PORT_RADIO, gpioModePushPull, 0);\n+ const uint8_t m_board_led_list[LEDS_NUMBER] = LEDS_LIST;\n+\n+ for (uint8_t l=0; l < LEDS_NUMBER; ++l)\n+ {\n+ nrf_gpio_cfg_output(m_board_led_list[l]);\n}\n-// red\n-void leds_error_on(void) {\n- GPIO_PinOutSet(gpioPortF, LEDS_PORT_ERROR);\n+ bsp_board_leds_off();\n}\n-void leds_error_off(void) {\n- GPIO_PinOutClear(gpioPortF, LEDS_PORT_ERROR);\n+\n+void leds_error_on(void)\n+{\n+ bsp_board_led_on(LED_IDX_ERROR);\n}\n-void leds_error_toggle(void) {\n- GPIO_PinOutToggle(gpioPortF, LEDS_PORT_ERROR);\n+void leds_error_off(void)\n+{\n+ bsp_board_led_off(LED_IDX_ERROR);\n}\n-uint8_t leds_error_isOn(void) {\n- return (uint8_t) (1 == GPIO_PinOutGet(gpioPortF, LEDS_PORT_ERROR));\n+void leds_error_toggle(void)\n+{\n+ bsp_board_led_invert(LED_IDX_ERROR);\n+}\n+\n+uint8_t leds_error_isOn(void)\n+{\n+ return((uint8_t) bsp_board_led_state_get(LED_IDX_ERROR));\n}\n-// orange\n-void leds_sync_on(void) {\n- GPIO_PinOutSet(gpioPortF, LEDS_PORT_SYNC);\n+\n+void leds_sync_on(void)\n+{\n+ bsp_board_led_on(LED_IDX_SYNC);\n}\n-void leds_sync_off(void) {\n- GPIO_PinOutClear(gpioPortF, LEDS_PORT_SYNC);\n+void leds_sync_off(void)\n+{\n+ bsp_board_led_off(LED_IDX_SYNC);\n}\n-void leds_sync_toggle(void) {\n- GPIO_PinOutToggle(gpioPortF, LEDS_PORT_SYNC);\n+void leds_sync_toggle(void)\n+{\n+ bsp_board_led_invert(LED_IDX_SYNC);\n}\n-uint8_t leds_sync_isOn(void) {\n- return (uint8_t) (1 == GPIO_PinOutGet(gpioPortF, LEDS_PORT_SYNC));\n+uint8_t leds_sync_isOn(void)\n+{\n+ return((uint8_t) bsp_board_led_state_get(LED_IDX_SYNC));\n}\n-// green\n-void leds_radio_on(void) {\n- GPIO_PinOutSet(gpioPortF, LEDS_PORT_RADIO);\n+\n+void leds_radio_on(void)\n+{\n+ bsp_board_led_on(LED_IDX_RADIO);\n}\n-void leds_radio_off(void) {\n- GPIO_PinOutClear(gpioPortF, LEDS_PORT_RADIO);\n+void leds_radio_off(void)\n+{\n+ bsp_board_led_off(LED_IDX_RADIO);\n}\n-void leds_radio_toggle(void) {\n- GPIO_PinOutToggle(gpioPortF, LEDS_PORT_RADIO);\n+void leds_radio_toggle(void)\n+{\n+ bsp_board_led_invert(LED_IDX_RADIO);\n}\n-uint8_t leds_radio_isOn(void) {\n- return (uint8_t) (1 == GPIO_PinOutGet(gpioPortF, LEDS_PORT_RADIO));\n+uint8_t leds_radio_isOn(void)\n+{\n+ return((uint8_t) bsp_board_led_state_get(LED_IDX_RADIO));\n}\n-// yellow\n-void leds_debug_on(void) {\n- GPIO_PinOutSet(gpioPortF, LEDS_PORT_DEBUG);\n+\n+void leds_debug_on(void)\n+{\n+ bsp_board_led_on(LED_IDX_DEBUG);\n}\n-void leds_debug_off(void) {\n- GPIO_PinOutClear(gpioPortF, LEDS_PORT_DEBUG);\n+void leds_debug_off(void)\n+{\n+ bsp_board_led_off(LED_IDX_DEBUG);\n}\n-void leds_debug_toggle(void) {\n- GPIO_PinOutToggle(gpioPortF, LEDS_PORT_DEBUG);\n+void leds_debug_toggle(void)\n+{\n+ bsp_board_led_invert(LED_IDX_DEBUG);\n}\n-uint8_t leds_debug_isOn(void) {\n- return (uint8_t) (1 == GPIO_PinOutGet(gpioPortF, LEDS_PORT_DEBUG));\n+uint8_t leds_debug_isOn(void)\n+{\n+ return((uint8_t) bsp_board_led_state_get(LED_IDX_DEBUG));\n}\n-// all\n-void leds_all_on(void) {\n+\n+void leds_all_on(void)\n+{\nleds_radio_on();\nleds_sync_on();\nleds_debug_on();\nleds_error_on();\n}\n-void leds_all_off(void) {\n+void leds_all_off(void)\n+{\nleds_radio_off();\nleds_sync_off();\nleds_debug_off();\nleds_error_off();\n}\n-void leds_all_toggle(void) {\n+void leds_all_toggle(void)\n+{\nleds_radio_toggle();\nleds_sync_toggle();\nleds_debug_toggle();\nleds_error_toggle();\n}\n-void leds_error_blink(void) {\n+void leds_error_blink(void)\n+{\nuint8_t i;\n- volatile uint16_t delay;\n// turn all LEDs off\nleds_all_off();\n// blink error LED for ~10s\n- for (i = 0; i < 80; i++) {\n+ for (i = 0; i < 100; i++)\n+ {\nleds_error_toggle();\n- for (delay = 0xffff; delay > 0; delay--)\n- ;\n- for (delay = 0xffff; delay > 0; delay--)\n- ;\n+ nrf_delay_ms(100);\n}\n}\n-void leds_circular_shift(void) {\n- //not implemented\n+void leds_circular_shift(void)\n+{\n+ bool led3_state= bsp_board_led_state_get(3);\n+ (bsp_board_led_state_get(2))?(bsp_board_led_on(3)):(bsp_board_led_off(3));\n+ (bsp_board_led_state_get(1))?(bsp_board_led_on(2)):(bsp_board_led_off(2));\n+ (bsp_board_led_state_get(0))?(bsp_board_led_on(1)):(bsp_board_led_off(1));\n+ (led3_state)?(bsp_board_led_on(0)):(bsp_board_led_off(0));\n+}\n+\n+void leds_increment(void)\n+{\n+ if (bsp_board_led_state_get(3))\n+ {\n+ leds_all_off();\n+ }\n+ else\n+ {\n+ if (bsp_board_led_state_get(2))\n+ {\n+ bsp_board_led_on(3);\nreturn;\n}\n-void leds_increment(void) {\n- //not implemented\n+ if (bsp_board_led_state_get(1))\n+ {\n+ bsp_board_led_on(2);\nreturn;\n}\n-*/\n+\n+ if (bsp_board_led_state_get(0))\n+ {\n+ bsp_board_led_on(1);\n+ return;\n+ }\n+\n+ bsp_board_led_on(0);\n+ }\n+}\n+\n//=========================== private =========================================\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/nrf52840dk/nrf52840_xxaa.ld",
"new_path": "bsp/boards/nrf52840dk/nrf52840_xxaa.ld",
"diff": "@@ -9,5 +9,16 @@ MEMORY\nRAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x40000\n}\n-\nINCLUDE \"nrf_common.ld\"\n+\n+SECTIONS\n+{\n+ .pwr_mgmt_data :\n+ {\n+ PROVIDE(__start_pwr_mgmt_data = .);\n+ KEEP(*(SORT(.pwr_mgmt_data*)))\n+ PROVIDE(__stop_pwr_mgmt_data = .);\n+ } > FLASH\n+}\n+\n+\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "bsp/boards/nrf52840dk/sdk/.vscode/c_cpp_properties.json",
"diff": "+{\n+ \"configurations\": [\n+ {\n+ \"name\": \"Mac\",\n+ \"includePath\": [\n+ \"/usr/include\",\n+ \"/usr/local/include\",\n+ \"${workspaceFolder}\"\n+ ],\n+ \"defines\": [],\n+ \"intelliSenseMode\": \"clang-x64\",\n+ \"browse\": {\n+ \"path\": [\n+ \"/usr/include\",\n+ \"/usr/local/include\",\n+ \"${workspaceFolder}\"\n+ ],\n+ \"limitSymbolsToIncludedHeaders\": true,\n+ \"databaseFilename\": \"\"\n+ },\n+ \"macFrameworkPath\": [\n+ \"/System/Library/Frameworks\",\n+ \"/Library/Frameworks\"\n+ ]\n+ },\n+ {\n+ \"name\": \"Linux\",\n+ \"includePath\": [\n+ \"/usr/include\",\n+ \"/usr/local/include\",\n+ \"${workspaceFolder}\"\n+ ],\n+ \"defines\": [],\n+ \"intelliSenseMode\": \"clang-x64\",\n+ \"browse\": {\n+ \"path\": [\n+ \"/usr/include\",\n+ \"/usr/local/include\",\n+ \"${workspaceFolder}\"\n+ ],\n+ \"limitSymbolsToIncludedHeaders\": true,\n+ \"databaseFilename\": \"\"\n+ }\n+ },\n+ {\n+ \"name\": \"Win32\",\n+ \"includePath\": [\n+ \"${workspaceFolder}\"\n+ ],\n+ \"defines\": [\n+ \"_DEBUG\",\n+ \"UNICODE\",\n+ \"_UNICODE\"\n+ ],\n+ \"intelliSenseMode\": \"msvc-x64\",\n+ \"browse\": {\n+ \"path\": [\n+ \"${workspaceFolder}\"\n+ ],\n+ \"limitSymbolsToIncludedHeaders\": true,\n+ \"databaseFilename\": \"\"\n+ },\n+ \"cStandard\": \"c11\",\n+ \"cppStandard\": \"c++17\"\n+ }\n+ ],\n+ \"version\": 3\n+}\n\\ No newline at end of file\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/nrf52840dk/sdk/config/nrf52810/config/sdk_config.h",
"new_path": "bsp/boards/nrf52840dk/sdk/config/nrf52810/config/sdk_config.h",
"diff": "// <e> NRFX_CLOCK_ENABLED - nrfx_clock - CLOCK peripheral driver\n//==========================================================\n#ifndef NRFX_CLOCK_ENABLED\n-#define NRFX_CLOCK_ENABLED 0\n+#define NRFX_CLOCK_ENABLED 1\n#endif\n// <o> NRFX_CLOCK_CONFIG_LF_SRC - LF Clock Source\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/nrf52840dk/sdk/config/nrf52832/config/sdk_config.h",
"new_path": "bsp/boards/nrf52840dk/sdk/config/nrf52832/config/sdk_config.h",
"diff": "// <e> NRFX_CLOCK_ENABLED - nrfx_clock - CLOCK peripheral driver\n//==========================================================\n#ifndef NRFX_CLOCK_ENABLED\n-#define NRFX_CLOCK_ENABLED 0\n+#define NRFX_CLOCK_ENABLED 1\n#endif\n// <o> NRFX_CLOCK_CONFIG_LF_SRC - LF Clock Source\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/nrf52840dk/sdk/config/nrf52840/config/sdk_config.h",
"new_path": "bsp/boards/nrf52840dk/sdk/config/nrf52840/config/sdk_config.h",
"diff": "// <e> CLOCK_ENABLED - nrf_drv_clock - CLOCK peripheral driver - legacy layer\n//==========================================================\n#ifndef CLOCK_ENABLED\n-#define CLOCK_ENABLED 0\n+#define CLOCK_ENABLED 1\n#endif\n// <o> CLOCK_CONFIG_LF_SRC - LF Clock Source\n// <e> NRFX_CLOCK_ENABLED - nrfx_clock - CLOCK peripheral driver\n//==========================================================\n#ifndef NRFX_CLOCK_ENABLED\n-#define NRFX_CLOCK_ENABLED 0\n+#define NRFX_CLOCK_ENABLED 1\n#endif\n// <o> NRFX_CLOCK_CONFIG_LF_SRC - LF Clock Source\n// <e> UART_ENABLED - nrf_drv_uart - UART/UARTE peripheral driver - legacy layer\n//==========================================================\n#ifndef UART_ENABLED\n-#define UART_ENABLED 0\n+#define UART_ENABLED 1\n#endif\n// <o> UART_DEFAULT_CONFIG_HWFC - Hardware Flow Control\n#ifndef UART_EASY_DMA_SUPPORT\n-#define UART_EASY_DMA_SUPPORT 1\n+#define UART_EASY_DMA_SUPPORT 0\n#endif\n// <q> UART_LEGACY_SUPPORT - Driver supporting Legacy mode\n// <e> UART0_ENABLED - Enable UART0 instance\n//==========================================================\n#ifndef UART0_ENABLED\n-#define UART0_ENABLED 0\n+#define UART0_ENABLED 1\n#endif\n// <q> UART0_CONFIG_USE_EASY_DMA - Default setting for using EasyDMA\n#ifndef UART0_CONFIG_USE_EASY_DMA\n-#define UART0_CONFIG_USE_EASY_DMA 1\n+#define UART0_CONFIG_USE_EASY_DMA 0\n#endif\n// </e>\n// <e> NRF_PWR_MGMT_ENABLED - nrf_pwr_mgmt - Power management module\n//==========================================================\n#ifndef NRF_PWR_MGMT_ENABLED\n-#define NRF_PWR_MGMT_ENABLED 0\n+#define NRF_PWR_MGMT_ENABLED 1\n#endif\n// <e> NRF_PWR_MGMT_CONFIG_DEBUG_PIN_ENABLED - Enables pin debug in the module.\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/nrf52840dk/sdk/modules/nrfx/templates/nRF52840/nrfx_config.h",
"new_path": "bsp/boards/nrf52840dk/sdk/modules/nrfx/templates/nRF52840/nrfx_config.h",
"diff": "// <i> This settings means only that components for DCDC regulator are installed and it can be enabled.\n#ifndef NRFX_POWER_CONFIG_DEFAULT_DCDCEN\n-#define NRFX_POWER_CONFIG_DEFAULT_DCDCEN 0\n+#define NRFX_POWER_CONFIG_DEFAULT_DCDCEN 1\n#endif\n// <q> NRFX_POWER_CONFIG_DEFAULT_DCDCENHV - The default configuration of High Voltage DCDC regulator\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "bsp/boards/nrf52840dk/uart.c",
"diff": "+ /**\n+ * Author: Tamas Harczos (tamas.harczos@imms.de)\n+ * Date: Apr 2018\n+ * Description: nRF52840-specific definition of the \"uart\" bsp module.\n+ */\n+\n+#include \"sdk/components/libraries/uart/app_uart.h\"\n+#include \"sdk/components/boards/pca10056.h\"\n+\n+// #if defined (UART_PRESENT)\n+// #include \"sdk/modules/nrfx/drivers/include/nrfx_uart.h\"\n+// #endif\n+// #if defined (UARTE_PRESENT)\n+// #include \"sdk/modules/nrfx/drivers/include/nrfx_uarte.h\"\n+// #endif\n+\n+#include \"board.h\"\n+#include \"leds.h\"\n+#include \"debugpins.h\"\n+#include \"uart.h\"\n+\n+#include <stdint.h>\n+#include <stdio.h>\n+#include <string.h>\n+\n+\n+//=========================== defines =========================================\n+\n+// see sdk/config/nrf52840/config/sdk_config.h for UART related settings\n+\n+//=========================== variables =======================================\n+\n+typedef struct\n+{\n+ uart_tx_cbt txCb;\n+ uart_rx_cbt rxCb;\n+} uart_vars_t;\n+\n+uart_vars_t uart_vars;\n+\n+//=========================== prototypes ======================================\n+\n+static void uart_event_handler(app_uart_evt_t * p_event);\n+\n+//=========================== public ==========================================\n+\n+void uart_init(void)\n+{\n+ // reset local variables\n+ memset(&uart_vars,0,sizeof(uart_vars_t));\n+\n+ // for the case that the UART has previously been initialized, uninitialize it first\n+ app_uart_close();\n+\n+ app_uart_comm_params_t const app_config =\n+ {\n+ .rx_pin_no= RX_PIN_NUMBER,\n+ .tx_pin_no= TX_PIN_NUMBER,\n+ .rts_pin_no= RTS_PIN_NUMBER,\n+ .cts_pin_no= CTS_PIN_NUMBER,\n+ .baud_rate= UART_DEFAULT_CONFIG_BAUDRATE,\n+ .use_parity= (UART_DEFAULT_CONFIG_PARITY != 0) ? (true) : (false),\n+ .flow_control= HWFC\n+ };\n+\n+ // if UART cannot be initialized, blink error LED for 10s, and then reset\n+ if (NRF_SUCCESS != app_uart_init(&app_config, NULL, uart_event_handler, APP_IRQ_PRIORITY_LOWEST))\n+ {\n+ leds_error_blink();\n+ board_reset();\n+ }\n+}\n+\n+void uart_setCallbacks(uart_tx_cbt txCb, uart_rx_cbt rxCb)\n+{\n+ uart_vars.txCb = txCb;\n+ uart_vars.rxCb = rxCb;\n+}\n+\n+void uart_enableInterrupts(void)\n+{\n+ // nrf_uart_int_enable(..., NRF_UART_INT_MASK_TXDRDY | NRF_UART_INT_MASK_RXDRDY | NRF_UART_INT_MASK_RXTO | NRF_UART_INT_MASK_ERROR);\n+}\n+\n+void uart_disableInterrupts(void)\n+{\n+ // nrf_uart_int_disable(..., NRF_UART_INT_MASK_TXDRDY | NRF_UART_INT_MASK_RXDRDY | NRF_UART_INT_MASK_RXTO | NRF_UART_INT_MASK_ERROR);\n+}\n+\n+void uart_clearRxInterrupts(void)\n+{\n+ // is handled within app_uart\n+}\n+\n+void uart_clearTxInterrupts(void)\n+{\n+ // is handled within app_uart\n+}\n+\n+void uart_writeByte(uint8_t byteToWrite)\n+{\n+ app_uart_put(byteToWrite);\n+}\n+\n+uint8_t uart_readByte(void)\n+{\n+ uint8_t newChar;\n+ app_uart_get(&newChar);\n+ return (newChar);\n+}\n+\n+//=========================== interrupt handlers ==============================\n+\n+void uart_event_handler(app_uart_evt_t * p_event)\n+{\n+ debugpins_isr_set();\n+\n+ if ((p_event->evt_type == APP_UART_COMMUNICATION_ERROR) || (p_event->evt_type == APP_UART_FIFO_ERROR) || (p_event->evt_type == APP_UART_FIFO_ERROR))\n+ {\n+ // handle error ...\n+ }\n+ else if ((p_event->evt_type == APP_UART_DATA) || (p_event->evt_type == APP_UART_DATA_READY))\n+ {\n+ // RX data has been received\n+ uart_rx_isr();\n+ }\n+ else if (p_event->evt_type == APP_UART_TX_EMPTY)\n+ {\n+ // TX data has been sent\n+ uart_tx_isr();\n+ }\n+\n+ debugpins_isr_clr();\n+}\n+\n+\n+kick_scheduler_t uart_tx_isr(void)\n+{\n+ uart_clearTxInterrupts();\n+\n+ if (uart_vars.txCb != NULL)\n+ {\n+ uart_vars.txCb();\n+ }\n+\n+ return DO_NOT_KICK_SCHEDULER;\n+}\n+\n+kick_scheduler_t uart_rx_isr(void)\n+{\n+ uart_clearRxInterrupts();\n+\n+ if (uart_vars.rxCb != NULL)\n+ {\n+ uart_vars.rxCb();\n+ }\n+\n+ return DO_NOT_KICK_SCHEDULER;\n+}\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-751.
leds, debugpins, and uart ported.
Next todos:
- port timers,
- revert changes in sdk/config/nrf*/config/sdk_config.h and make relevant defines in board_info.h or per compiler flag in SConscript
- remove irrelevant parts of the SDK
|
491,595 |
27.04.2018 16:34:37
| -7,200 |
c1efcfc7bd2ded7ace25d6942f16b2177a3433a6
|
further reduce the execution time of inhibit timer.
|
[
{
"change_type": "MODIFY",
"old_path": "openstack/02a-MAClow/IEEE802154E.c",
"new_path": "openstack/02a-MAClow/IEEE802154E.c",
"diff": "@@ -63,8 +63,6 @@ void activity_rie5(void);\nvoid activity_ri8(PORT_TIMER_WIDTH capturedTime);\nvoid activity_rie6(void);\nvoid activity_ri9(PORT_TIMER_WIDTH capturedTime);\n-// inhibit serial\n-void activity_inhibitSerial(void);\n// frame validity check\nbool isValidRxFrame(ieee802154_header_iht* ieee802514_header);\n@@ -101,6 +99,7 @@ bool debugPrint_isSync(void);\n// interrupts\nvoid isr_ieee154e_newSlot(opentimers_id_t id);\nvoid isr_ieee154e_timer(opentimers_id_t id);\n+void isr_ieee154e_inhibitStart(opentimers_id_t id);\n//=========================== admin ===========================================\n@@ -375,12 +374,6 @@ void isr_ieee154e_timer(opentimers_id_t id) {\nbreak;\ncase S_SYNCRX:\nbreak;\n- case S_SLEEP:\n- activity_inhibitSerial();\n- break;\n- case S_SYNCLISTEN:\n- activity_inhibitSerial();\n- break;\ndefault:\n// log the error\nopenserial_printCritical(\n@@ -396,6 +389,18 @@ void isr_ieee154e_timer(opentimers_id_t id) {\nieee154e_dbg.num_timer++;\n}\n+/**\n+\\brief Inhibit the serial activity.\n+\n+This needs to happen\n+\n+This function executes in ISR mode.\n+*/\n+void isr_ieee154e_inhibitStart(opentimers_id_t id) {\n+ // inhibit serial activity\n+ openserial_inhibitStart(); // activity_inhibitSerial\n+}\n+\n/**\n\\brief Indicates the radio just received the first byte of a packet.\n@@ -599,7 +604,7 @@ port_INLINE void activity_synchronize_newSlot(void) {\nDURATION_si, // duration\nieee154e_vars.startOfSlotReference, // reference\nTIME_TICS, // timetype\n- isr_ieee154e_timer // callback\n+ isr_ieee154e_inhibitStart // callback\n);\nopenserial_inhibitStop();\n@@ -2203,18 +2208,6 @@ port_INLINE void activity_ri9(PORT_TIMER_WIDTH capturedTime) {\nendSlot();\n}\n-/**\n-\\brief Inhibit the serial activity.\n-\n-This needs to happen\n-\n-This function executes in ISR mode.\n-*/\n-port_INLINE void activity_inhibitSerial(void) {\n- // inhibit serial activity\n- openserial_inhibitStart(); // activity_inhibitSerial\n-}\n-\n//======= frame validity check\n/**\n@@ -2977,7 +2970,7 @@ void endSlot(void) {\nDURATION_si, // duration\nieee154e_vars.startOfSlotReference, // reference\nTIME_TICS, // timetype\n- isr_ieee154e_timer // callback\n+ isr_ieee154e_inhibitStart // callback\n);\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/python/SConscript.env",
"new_path": "projects/python/SConscript.env",
"diff": "@@ -485,6 +485,7 @@ functionsToChange = [\n'ieee154e_orderToASNStructure',\n'isr_ieee154e_newSlot',\n'isr_ieee154e_timer',\n+ 'isr_ieee154e_inhibitStart',\n'ieee154e_startOfFrame',\n'ieee154e_endOfFrame',\n'debugPrint_asn',\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-540. further reduce the execution time of inhibit timer.
|
491,595 |
27.04.2018 18:42:27
| -7,200 |
643201fd9d0dbc255c0c626996bafae06bfd0d70
|
push "printing error message " as a task so it doesn't influence the following incoming bytes if any.
|
[
{
"change_type": "MODIFY",
"old_path": "drivers/common/openserial.c",
"new_path": "drivers/common/openserial.c",
"diff": "#include \"opendefs.h\"\n#include \"openserial.h\"\n+#include \"scheduler.h\"\n#include \"IEEE802154E.h\"\n#include \"neighbors.h\"\n#include \"sixtop.h\"\n@@ -68,6 +69,10 @@ void inputHdlcOpen(void);\nvoid inputHdlcWrite(uint8_t b);\nvoid inputHdlcClose(void);\n+// task\n+void task_printWrongCRCInput(void);\n+void task_printInputBufferOverflow(void);\n+\n//=========================== public ==========================================\n//===== admin\n@@ -985,6 +990,28 @@ port_INLINE void inputHdlcClose(void) {\n}\n}\n+//=========================== task ============================================\n+\n+void task_printInputBufferOverflow(void){\n+ // input buffer overflow\n+ openserial_printError(\n+ COMPONENT_OPENSERIAL,\n+ ERR_INPUT_BUFFER_OVERFLOW,\n+ (errorparameter_t)0,\n+ (errorparameter_t)0\n+ );\n+}\n+\n+void task_printWrongCRCInput(void){\n+ // invalid HDLC frame\n+ openserial_printError(\n+ COMPONENT_OPENSERIAL,\n+ ERR_WRONG_CRC_INPUT,\n+ (errorparameter_t)0,\n+ (errorparameter_t)0\n+ );\n+}\n+\n//=========================== interrupt handlers ==============================\n// executed in ISR, called from scheduler.c\n@@ -1024,6 +1051,7 @@ void isr_openserial_tx(void) {\n\\returns 1 if don't receiving frame, 0 if not\n*/\n+\nuint8_t isr_openserial_rx(void) {\nuint8_t rxbyte;\nuint8_t returnVal;\n@@ -1057,13 +1085,8 @@ uint8_t isr_openserial_rx(void) {\n// add the byte just received\ninputHdlcWrite(rxbyte);\nif (openserial_vars.inputBufFillLevel+1>SERIAL_INPUT_BUFFER_SIZE){\n- // input buffer overflow\n- openserial_printError(\n- COMPONENT_OPENSERIAL,\n- ERR_INPUT_BUFFER_OVERFLOW,\n- (errorparameter_t)0,\n- (errorparameter_t)0\n- );\n+ // push task\n+ scheduler_push_task(task_printInputBufferOverflow,TASKPRIO_OPENSERIAL);\nopenserial_vars.inputBufFillLevel = 0;\nopenserial_vars.hdlcBusyReceiving = FALSE;\n}\n@@ -1078,13 +1101,8 @@ uint8_t isr_openserial_rx(void) {\nopenserial_vars.hdlcBusyReceiving = FALSE;\nif (openserial_vars.inputBufFillLevel==0){\n- // invalid HDLC frame\n- openserial_printError(\n- COMPONENT_OPENSERIAL,\n- ERR_WRONG_CRC_INPUT,\n- (errorparameter_t)openserial_vars.inputBufFillLevel,\n- (errorparameter_t)0\n- );\n+ // push task\n+ scheduler_push_task(task_printWrongCRCInput,TASKPRIO_OPENSERIAL);\n} else {\nopenserial_handleRxFrame();\nopenserial_vars.inputBufFillLevel = 0;\n"
},
{
"change_type": "MODIFY",
"old_path": "inc/opendefs.h",
"new_path": "inc/opendefs.h",
"diff": "@@ -243,7 +243,7 @@ enum {\nERR_INVALIDSERIALFRAME = 0x36, // invalid serial frame\nERR_INVALIDPACKETFROMRADIO = 0x37, // invalid packet frome radio, length {1} (code location {0})\nERR_BUSY_RECEIVING = 0x38, // busy receiving when stop of serial activity, buffer input length {1} (code location {0})\n- ERR_WRONG_CRC_INPUT = 0x39, // wrong CRC in input Buffer (input length {0})\n+ ERR_WRONG_CRC_INPUT = 0x39, // wrong CRC in input Buffer\nERR_PACKET_SYNC = 0x3a, // synchronized when received a packet\nERR_SECURITY = 0x3b, // security error on frameType {0}, code location {1}\nERR_SIXTOP_RETURNCODE = 0x3c, // sixtop return code {0} at sixtop state {1}\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/python/SConscript.env",
"new_path": "projects/python/SConscript.env",
"diff": "@@ -409,6 +409,8 @@ functionsToChange = [\n'openserial_printCritical',\n'openserial_ackReply',\n'task_openserial_debugPrint',\n+ 'task_printInputBufferOverflow',\n+ 'task_printWrongCRCInput',\n'openserial_print_str',\n'openserial_print_uint32_t',\n'openserial_board_reset_cb',\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-540. push "printing error message " as a task so it doesn't influence the following incoming bytes if any.
|
491,595 |
30.04.2018 14:44:09
| -7,200 |
d455493fbcbffb3119161bd64afff47cc6e3b10e
|
correct the sac and dac value.
|
[
{
"change_type": "MODIFY",
"old_path": "openstack/03b-IPv6/forwarding.c",
"new_path": "openstack/03b-IPv6/forwarding.c",
"diff": "@@ -116,8 +116,6 @@ owerror_t forwarding_send(OpenQueueEntry_t* msg) {\ndac = IPHC_DAC_STATELESS;\n} else {\nmyprefix = idmanager_getMyID(ADDR_PREFIX);\n- sac = IPHC_SAC_STATEFUL;\n- dac = IPHC_DAC_STATEFUL;\n}\nmemcpy(&(msg->l3_sourceAdd.addr_128b[0]),myprefix->prefix,8);\nmemcpy(&(msg->l3_sourceAdd.addr_128b[8]),myadd64->addr_64b,8);\n@@ -151,6 +149,8 @@ owerror_t forwarding_send(OpenQueueEntry_t* msg) {\n//XV -poipoi we want to check if the source address prefix is the same as destination prefix\nif (packetfunctions_sameAddress(&temp_dest_prefix,&temp_src_prefix)) {\n// same prefix use 64B address\n+ sac = IPHC_SAC_STATEFUL;\n+ dac = IPHC_DAC_STATEFUL;\nsam = IPHC_SAM_64B;\ndam = IPHC_DAM_64B;\np_dest = &temp_dest_mac64b;\n@@ -159,6 +159,8 @@ owerror_t forwarding_send(OpenQueueEntry_t* msg) {\n//not the same prefix. so the packet travels to another network\n//check if this is a source routing pkt. in case it is then the DAM is elided as it is in the SrcRouting header.\nif (packetfunctions_isBroadcastMulticast(&(msg->l3_destinationAdd))==FALSE){\n+ sac = IPHC_SAC_STATELESS;\n+ dac = IPHC_DAC_STATELESS;\nsam = IPHC_SAM_128B;\ndam = IPHC_DAM_128B;\np_dest = &(msg->l3_destinationAdd);\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-756. correct the sac and dac value.
|
491,604 |
01.05.2018 16:52:55
| -7,200 |
3a7c66b73300808c58ec9fbf230aac1624812d7e
|
SPI port work in progress, not working at the moment
|
[
{
"change_type": "ADD",
"old_path": null,
"new_path": "bsp/boards/nrf52840dk/spi.c",
"diff": "+/**\n+ * Author: Adam Sedmak (adam.sedmak@gmail.com)\n+ * Company: Faculty of Electronics and Computing, Zagreb, Croatia\n+ * Date: Apr 2018\n+ * Description: nRF52840-specific definition of the \"spi\" bsp module.\n+ */\n+\n+#include \"sdk/components/boards/pca10056.h\"\n+#include \"sdk/components/boards/boards.h\"\n+#include \"sdk/components/libraries/delay/nrf_delay.h\"\n+#include \"sdk/integration/nrfx/legacy/nrf_drv_spi.h\"\n+#include \"sdk/components/libraries/util/app_error.h\"\n+\n+#include <string.h>\n+#include \"stdint.h\"\n+#include \"spi.h\"\n+#include \"board.h\"\n+#include \"board_info.h\"\n+\n+//=========================== defines =========================================\n+#define SPI_SS_PIN 29\n+#define SPI_MISO_PIN 28\n+#define SPI_MOSI_PIN 4\n+#define SPI_SCK_PIN 3\n+\n+#define SPI_INSTANCE 0 /**< SPI instance index. */\n+#define BUF_SIZE 20\n+\n+//=========================== variables =======================================\n+static const nrf_drv_spi_t spi = NRF_DRV_SPI_INSTANCE(SPI_INSTANCE); /**< SPI instance. */\n+static volatile bool spi_xfer_done; /**< Flag used to indicate that SPI instance completed the transfer. */\n+static uint8_t m_rx_buf[BUF_SIZE];\n+//=========================== prototypes ======================================\n+void spi_event_handler(nrf_drv_spi_evt_t const * p_event,\n+ void * p_context);\n+//=========================== public ==========================================\n+void spi_init(void)\n+{\n+ nrf_drv_spi_config_t spi_config = NRF_DRV_SPI_DEFAULT_CONFIG;\n+\n+ spi_config.ss_pin = SPI_SS_PIN;\n+ spi_config.miso_pin = SPI_MISO_PIN;\n+ spi_config.mosi_pin = SPI_MOSI_PIN;\n+ spi_config.sck_pin = SPI_SCK_PIN;\n+\n+ APP_ERROR_CHECK(nrf_drv_spi_init(&spi, &spi_config, spi_event_handler, NULL));\n+\n+}\n+\n+void spi_txrx(uint8_t* bufTx,\n+ uint8_t lenbufTx,\n+ spi_return_t returnType,\n+ uint8_t* bufRx,\n+ uint8_t maxLenBufRx,\n+ spi_first_t isFirst,\n+ spi_last_t isLast)\n+{\n+\n+}\n+\n+// interrupt handlers\n+//kick_scheduler_t spi_isr(void)\n+//{\n+\n+//}\n+//=========================== private =========================================\n+\n+/**\n+ * @brief SPI user event handler.\n+ * @param event\n+ */\n+void spi_event_handler(nrf_drv_spi_evt_t const * p_event,\n+ void * p_context)\n+{\n+ spi_xfer_done = true;\n+ //NRF_LOG_INFO(\"Transfer completed.\");\n+ if (m_rx_buf[0] != 0)\n+ {\n+ //NRF_LOG_INFO(\" Received:\");\n+ //NRF_LOG_HEXDUMP_INFO(m_rx_buf, strlen((const char *)m_rx_buf));\n+ }\n+}\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
SPI port work in progress, not working at the moment
|
491,604 |
05.05.2018 14:08:44
| -7,200 |
95929bab8638b5b03b25818a85efa54065f05297
|
removed legacy drivers
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/nrf52840dk/app_config.h",
"new_path": "bsp/boards/nrf52840dk/app_config.h",
"diff": "#define NRFX_SPI_ENABLED\n#define NRFX_SPI0_ENABLED\n#define NRFX_SPIM0_ENABLED\n-// #define SPI_ENABLED\n+#define SPI_ENABLED\n// #define SPI0_ENABLED\n// power management\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/nrf52840dk/spi.c",
"new_path": "bsp/boards/nrf52840dk/spi.c",
"diff": "#include \"sdk/components/boards/pca10056.h\"\n#include \"sdk/components/boards/boards.h\"\n#include \"sdk/components/libraries/delay/nrf_delay.h\"\n-#include \"sdk/integration/nrfx/legacy/nrf_drv_spi.h\"\n-#include \"sdk/components/libraries/util/app_error.h\"\n+#include \"sdk/modules/nrfx/drivers/include/nrfx_spi.h\"\n+//#include \"sdk/components/libraries/util/app_error.h\"\n#include <string.h>\n#include \"stdint.h\"\n#define BUF_SIZE 20\n//=========================== variables =======================================\n-static const nrf_drv_spi_t spi = NRF_DRV_SPI_INSTANCE(SPI_INSTANCE); /**< SPI instance. */\n+static const nrf_spi_t spi = NRF_SPI_INSTANCE(SPI_INSTANCE); /**< SPI instance. */\nstatic volatile bool spi_xfer_done; /**< Flag used to indicate that SPI instance completed the transfer. */\nstatic uint8_t m_rx_buf[BUF_SIZE];\n//=========================== prototypes ======================================\n-void spi_event_handler(nrf_drv_spi_evt_t const * p_event,\n+void spi_event_handler(nrf_spi_evt_t const * p_event,\nvoid * p_context);\n//=========================== public ==========================================\nvoid spi_init(void)\n{\n- nrf_drv_spi_config_t spi_config = NRF_DRV_SPI_DEFAULT_CONFIG;\n+ nrf_spi_config_t spi_config = NRF_SPI_DEFAULT_CONFIG;\nspi_config.ss_pin = SPI_SS_PIN;\nspi_config.miso_pin = SPI_MISO_PIN;\nspi_config.mosi_pin = SPI_MOSI_PIN;\nspi_config.sck_pin = SPI_SCK_PIN;\n- APP_ERROR_CHECK(nrf_drv_spi_init(&spi, &spi_config, spi_event_handler, NULL));\n+ APP_ERROR_CHECK(nrf_spi_init(&spi, &spi_config, spi_event_handler, NULL));\n}\n@@ -69,7 +69,7 @@ void spi_txrx(uint8_t* bufTx,\n* @brief SPI user event handler.\n* @param event\n*/\n-void spi_event_handler(nrf_drv_spi_evt_t const * p_event,\n+void spi_event_handler(nrf_spi_evt_t const * p_event,\nvoid * p_context)\n{\nspi_xfer_done = true;\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
removed legacy drivers
|
491,604 |
09.05.2018 16:41:22
| -7,200 |
4d4978f95beb22654662b22dedbc2122712bdb92
|
configuration working
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/nrf52840dk/app_config.h",
"new_path": "bsp/boards/nrf52840dk/app_config.h",
"diff": "#define UART0_CONFIG_USE_EASY_DMA 0\n// SPI\n-#define NRFX_SPI_ENABLED\n-#define NRFX_SPI0_ENABLED\n-#define NRFX_SPIM0_ENABLED\n+//#define NRFX_SPI_ENABLED\n+//#define NRFX_SPI0_ENABLED\n+//#define NRFX_SPIM0_ENABLED\n#define SPI_ENABLED\n-// #define SPI0_ENABLED\n+#define SPI0_ENABLED 1\n+#define SPI0_USE_EASY_DMA 0\n// power management\n#define NRF_PWR_MGMT_ENABLED 1\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/nrf52840dk/spi.c",
"new_path": "bsp/boards/nrf52840dk/spi.c",
"diff": "#include \"sdk/components/boards/boards.h\"\n#include \"sdk/components/libraries/delay/nrf_delay.h\"\n#include \"sdk/modules/nrfx/drivers/include/nrfx_spi.h\"\n-//#include \"sdk/components/libraries/util/app_error.h\"\n-#include <string.h>\n-#include \"stdint.h\"\n+#include \"app_config.h\"\n+#include \"leds.h\"\n#include \"spi.h\"\n#include \"board.h\"\n#include \"board_info.h\"\n+#include \"debugpins.h\"\n+\n+#include <string.h>\n+#include <stdint.h>\n+#include <stdio.h>\n//=========================== defines =========================================\n#define SPI_SS_PIN 29\n#define BUF_SIZE 20\n//=========================== variables =======================================\n-static const nrf_spi_t spi = NRF_SPI_INSTANCE(SPI_INSTANCE); /**< SPI instance. */\n+static const nrfx_spi_t spi = NRFX_SPI_INSTANCE(SPI_INSTANCE); /**< SPI instance. */\nstatic volatile bool spi_xfer_done; /**< Flag used to indicate that SPI instance completed the transfer. */\nstatic uint8_t m_rx_buf[BUF_SIZE];\n//=========================== prototypes ======================================\n-void spi_event_handler(nrf_spi_evt_t const * p_event,\n- void * p_context);\n+void spi_event_handler(nrfx_spi_evt_t const * p_event,void * p_context);\n//=========================== public ==========================================\nvoid spi_init(void)\n{\n- nrf_spi_config_t spi_config = NRF_SPI_DEFAULT_CONFIG;\n+ nrfx_spi_config_t spi_config = NRFX_SPI_DEFAULT_CONFIG;\nspi_config.ss_pin = SPI_SS_PIN;\nspi_config.miso_pin = SPI_MISO_PIN;\nspi_config.mosi_pin = SPI_MOSI_PIN;\nspi_config.sck_pin = SPI_SCK_PIN;\n- APP_ERROR_CHECK(nrf_spi_init(&spi, &spi_config, spi_event_handler, NULL));\n+ if(NRF_SUCCESS != nrfx_spi_init(&spi, &spi_config, spi_event_handler, NULL))\n+ {\n+ leds_error_blink();\n+ board_reset();\n+ }\n}\n-void spi_txrx(uint8_t* bufTx,\n- uint8_t lenbufTx,\n- spi_return_t returnType,\n- uint8_t* bufRx,\n- uint8_t maxLenBufRx,\n- spi_first_t isFirst,\n- spi_last_t isLast)\n-{\n+//void spi_txrx(uint8_t* bufTx,\n+// uint8_t lenbufTx,\n+// spi_return_t returnType,\n+// uint8_t* bufRx,\n+// uint8_t maxLenBufRx,\n+// spi_first_t isFirst,\n+// spi_last_t isLast)\n+//{\n-}\n+//}\n// interrupt handlers\n//kick_scheduler_t spi_isr(void)\n@@ -69,7 +76,7 @@ void spi_txrx(uint8_t* bufTx,\n* @brief SPI user event handler.\n* @param event\n*/\n-void spi_event_handler(nrf_spi_evt_t const * p_event,\n+void spi_event_handler(nrfx_spi_evt_t const * p_event,\nvoid * p_context)\n{\nspi_xfer_done = true;\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
configuration working
|
491,604 |
10.05.2018 18:01:47
| -7,200 |
73d25f34c589632451bb7c49a803e84789378f60
|
added txrx functionality to SPI
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/nrf52840dk/spi.c",
"new_path": "bsp/boards/nrf52840dk/spi.c",
"diff": "#include <stdio.h>\n//=========================== defines =========================================\n+\n#define SPI_SS_PIN 29\n#define SPI_MISO_PIN 28\n#define SPI_MOSI_PIN 4\n#define BUF_SIZE 20\n//=========================== variables =======================================\n+\nstatic const nrfx_spi_t spi = NRFX_SPI_INSTANCE(SPI_INSTANCE); /**< SPI instance. */\nstatic volatile bool spi_xfer_done; /**< Flag used to indicate that SPI instance completed the transfer. */\n-static uint8_t m_rx_buf[BUF_SIZE];\n+//static uint8_t m_rx_buf[BUF_SIZE];\n+\n//=========================== prototypes ======================================\n+\nvoid spi_event_handler(nrfx_spi_evt_t const * p_event,void * p_context);\n+\n//=========================== public ==========================================\n+\nvoid spi_init(void)\n{\nnrfx_spi_config_t spi_config = NRFX_SPI_DEFAULT_CONFIG;\n@@ -54,22 +60,42 @@ void spi_init(void)\n}\n-//void spi_txrx(uint8_t* bufTx,\n-// uint8_t lenbufTx,\n-// spi_return_t returnType,\n-// uint8_t* bufRx,\n-// uint8_t maxLenBufRx,\n-// spi_first_t isFirst,\n-// spi_last_t isLast)\n-//{\n+void spi_txrx(uint8_t* bufTx,\n+ uint8_t lenbufTx,\n+ spi_return_t returnType,\n+ uint8_t* bufRx,\n+ uint8_t maxLenBufRx,\n+ spi_first_t isFirst,\n+ spi_last_t isLast)\n+{\n-//}\n+ // Fill in transfer descriptor\n+ nrfx_spi_xfer_desc_t nrfx_spi_xfer_desc;\n-// interrupt handlers\n-//kick_scheduler_t spi_isr(void)\n-//{\n+ nrfx_spi_xfer_desc.p_tx_buffer = bufTx;\n+ nrfx_spi_xfer_desc.tx_length = lenbufTx;\n+ nrfx_spi_xfer_desc.p_rx_buffer = bufRx;\n+ nrfx_spi_xfer_desc.rx_length = maxLenBufRx;\n+\n+ memset(bufRx, 0, maxLenBufRx);\n+\n+ spi_xfer_done = false;\n+\n+ if (NRFX_SUCCESS != nrfx_spi_xfer(&spi, &nrfx_spi_xfer_desc, 0))\n+ {\n+ leds_error_blink();\n+ }\n+\n+ while (!spi_xfer_done){\n+ __WFE();\n+ }\n+}\n-//}\n+// interrupt handlers\n+kick_scheduler_t spi_isr(void)\n+{\n+ return DO_NOT_KICK_SCHEDULER;\n+}\n//=========================== private =========================================\n/**\n@@ -80,10 +106,4 @@ void spi_event_handler(nrfx_spi_evt_t const * p_event,\nvoid * p_context)\n{\nspi_xfer_done = true;\n- //NRF_LOG_INFO(\"Transfer completed.\");\n- if (m_rx_buf[0] != 0)\n- {\n- //NRF_LOG_INFO(\" Received:\");\n- //NRF_LOG_HEXDUMP_INFO(m_rx_buf, strlen((const char *)m_rx_buf));\n- }\n}\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
added txrx functionality to SPI
|
491,604 |
11.05.2018 14:25:57
| -7,200 |
2d5289ef08c94927347eae3e9dba57708f3b02a7
|
timer still in development
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/nrf52840dk/app_config.h",
"new_path": "bsp/boards/nrf52840dk/app_config.h",
"diff": "#define SPI0_ENABLED 1\n#define SPI0_USE_EASY_DMA 0\n+// TIMER\n+#define TIMER_ENABLED\n+#define TIMER0_ENABLED 1\n+#define TIMER0_USE_EASY_DMA 0\n+\n// power management\n#define NRF_PWR_MGMT_ENABLED 1\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "bsp/boards/nrf52840dk/sctimer.c",
"diff": "+/**\n+ * brief A timer module with only a single compare value.\n+ *\n+ * Author: Adam Sedmak (adam.sedmak@gmail.com)\n+ * Company: Faculty of Electronics and Computing, Zagreb, Croatia\n+ * Date: Apr 2018\n+*/\n+\n+#include \"sdk/components/boards/pca10056.h\"\n+#include \"sdk/components/boards/boards.h\"\n+#include \"sdk/modules/nrfx/drivers/include/nrfx_timer.h\"\n+\n+#include \"sctimer.h\"\n+#include \"board.h\"\n+#include \"leds.h\"\n+\n+// ========================== define ==========================================\n+\n+#define TIMERLOOP_THRESHOLD 0x4000 // 0.5 seconds @ 32768Hz clock\n+#define MINIMUM_COMPAREVALE_ADVANCE 3\n+#define SCTIMER_INSTANCE 0\n+\n+// ========================== variable ========================================\n+\n+typedef struct {\n+ sctimer_cbt cb;\n+ sctimer_capture_cbt startFrameCb;\n+ sctimer_capture_cbt endFrameCb;\n+ uint8_t f_SFDreceived;\n+} sctimer_vars_t;\n+\n+sctimer_vars_t sctimer_vars;\n+\n+const nrfx_timer_t timer = NRFX_TIMER_INSTANCE(SCTIMER_INSTANCE);\n+\n+// ========================== prototypes========================================\n+\n+void timer_event_handler(nrf_timer_event_t const * p_event, void * p_context);\n+\n+// ========================== protocol =========================================\n+\n+/**\n+\\brief Initialization sctimer.\n+*/\n+void sctimer_init(void)\n+{\n+ memset(&sctimer_vars, 0, sizeof(sctimer_vars_t));\n+ nrfx_timer_config_t nrfx_timer = NRFX_TIMER_DEFAULT_CONFIG;\n+\n+ if(NRFX_SUCCESS != nrfx_timer_init(&timer, &nrfx_timer, timer_event_handler))\n+ {\n+ leds_error_blink();\n+ board_reset();\n+ }\n+}\n+\n+void sctimer_set_callback(sctimer_cbt cb)\n+{\n+ sctimer_vars.cb = cb;\n+}\n+\n+void sctimer_setStartFrameCb(sctimer_capture_cbt cb)\n+{\n+ sctimer_vars.startFrameCb = cb;\n+}\n+\n+void sctimer_setEndFrameCb(sctimer_capture_cbt cb)\n+{\n+ sctimer_vars.endFrameCb = cb;\n+}\n+\n+/**\n+\\brief set compare interrupt\n+*/\n+void sctimer_setCompare(PORT_TIMER_WIDTH val)\n+{\n+\n+}\n+\n+/**\n+\\brief Return the current value of the timer's counter.\n+\n+ \\returns The current value of the timer's counter.\n+*/\n+PORT_TIMER_WIDTH sctimer_readCounter(void)\n+{\n+\n+}\n+\n+void sctimer_enable(void)\n+{\n+ nrfx_timer_enable(&timer);\n+}\n+\n+void sctimer_disable(void)\n+{\n+ nrfx_timer_disable(&timer);\n+}\n+\n+// ========================== private =========================================\n+\n+void timer_event_handler(nrf_timer_event_t const * p_event,\n+ void * p_context)\n+{\n+\n+}\n+\n+//=========================== interrupt handlers ==============================\n+\n+/**\n+\\brief TimerB CCR1-6 interrupt service routine\n+*/\n+kick_scheduler_t sctimer_isr(void) {\n+ PORT_TIMER_WIDTH tbiv_local;\n+\n+ // reading TBIV returns the value of the highest pending interrupt flag\n+ // and automatically resets that flag. We therefore copy its value to the\n+ // tbiv_local local variable exactly once. If there is more than one\n+ // interrupt pending, we will reenter this function after having just left\n+ // it.\n+\n+ return DO_NOT_KICK_SCHEDULER;\n+}\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/nrf52840dk/spi.c",
"new_path": "bsp/boards/nrf52840dk/spi.c",
"diff": "#include \"sdk/components/boards/pca10056.h\"\n#include \"sdk/components/boards/boards.h\"\n-#include \"sdk/components/libraries/delay/nrf_delay.h\"\n#include \"sdk/modules/nrfx/drivers/include/nrfx_spi.h\"\n#include \"app_config.h\"\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
timer still in development
|
491,605 |
22.05.2018 08:39:16
| -7,200 |
62e7bcb1ea64880ecdd8a4974b8cbe71cce562e7
|
bsp_leds working again
|
[
{
"change_type": "MODIFY",
"old_path": "SConscript",
"new_path": "SConscript",
"diff": "@@ -441,8 +441,8 @@ elif env['toolchain']=='armgcc':\nenv.Append(LINKFLAGS = '-g -gdwarf-2 -mcpu=cortex-m4 -mthumb')\n# @todo: Decide which linker script to use\n- # env.Append(LINKFLAGS = '-Tbsp/boards/nrf52840dk/nrf52840_xxaa.ld')\n- env.Append(LINKFLAGS = '-Tbsp/boards/nrf52840dk/sdk/config/nrf52840/armgcc/generic_gcc_nrf52.ld')\n+ env.Append(LINKFLAGS = '-Tbsp/boards/nrf52840dk/nrf52840_xxaa.ld')\n+ # env.Append(LINKFLAGS = '-Tbsp/boards/nrf52840dk/sdk/config/nrf52840/armgcc/generic_gcc_nrf52.ld')\n# env.Append(LINKFLAGS = '--strip-debug')\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/nrf52840dk/board.c",
"new_path": "bsp/boards/nrf52840dk/board.c",
"diff": "@@ -67,8 +67,9 @@ void board_init(void)\n// initialize boards with LEDs and buttons\nbsp_board_init(BSP_INIT_LEDS | BSP_INIT_BUTTONS);\n-// button_init();\n-// debugpins_init();\n+ button_init();\n+ leds_init();\n+ debugpins_init();\n// bsp_timer_init();\n// radiotimer_init();\n// uart_init();\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
bsp_leds working again
|
491,605 |
22.05.2018 13:03:18
| -7,200 |
02919cda10b7b9fa3f4fc4eaf93e9e0d0a00bfb2
|
SPI implementation checked. returnType, isFirst, and isLast still needs to be done.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/nrf52840dk/SConscript",
"new_path": "bsp/boards/nrf52840dk/SConscript",
"diff": "@@ -14,6 +14,7 @@ source = \\\nGlob('sdk/components/boards/boards.c') + \\\nGlob('sdk/modules/nrfx/drivers/src/nrfx_clock.c') + \\\nGlob('sdk/modules/nrfx/drivers/src/nrfx_power.c') + \\\n+ Glob('sdk/modules/nrfx/drivers/src/nrfx_spi.c') + \\\nGlob('sdk/components/libraries/experimental_section_vars/*.c') + \\\nGlob('sdk/components/libraries/pwr_mgmt/*.c') + \\\nGlob('sdk/components/libraries/uart/*.c') + \\\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/nrf52840dk/app_config.h",
"new_path": "bsp/boards/nrf52840dk/app_config.h",
"diff": "//#define NRFX_SPI_ENABLED\n//#define NRFX_SPI0_ENABLED\n//#define NRFX_SPIM0_ENABLED\n-#define SPI_ENABLED\n+#define SPI_ENABLED 1\n#define SPI0_ENABLED 1\n#define SPI0_USE_EASY_DMA 0\n// TIMER\n-#define TIMER_ENABLED\n+#define TIMER_ENABLED 1\n#define TIMER0_ENABLED 1\n#define TIMER0_USE_EASY_DMA 0\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/nrf52840dk/spi.c",
"new_path": "bsp/boards/nrf52840dk/spi.c",
"diff": "@@ -85,7 +85,8 @@ void spi_txrx(uint8_t* bufTx,\nleds_error_blink();\n}\n- while (!spi_xfer_done){\n+ while (!spi_xfer_done)\n+ {\n__WFE();\n}\n}\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
SPI implementation checked. returnType, isFirst, and isLast still needs to be done.
|
491,605 |
23.05.2018 15:11:14
| -7,200 |
b114b3cfa83ce77a5eccbfc8f7ee33af793486a4
|
Added further ports. Timer implementation still seems to be buggy (02drv_opentimers project hangs after several minutes).
|
[
{
"change_type": "MODIFY",
"old_path": "SConscript",
"new_path": "SConscript",
"diff": "@@ -430,6 +430,7 @@ elif env['toolchain']=='armgcc':\nenv.Append(CCFLAGS = '-DUSE_APP_CONFIG=1')\nenv.Append(CCFLAGS = '-DNRF52840_XXAA=1') # set the CPU to nRF52840 (ARM Cortex M4f)\nenv.Append(CCFLAGS = '-DBOARD_PCA10056=1') # set the board to be the nRF52840 Development Kit\n+ env.Append(CCFLAGS = '-DCONFIG_GPIO_AS_PINRESET=1') # just to be able to reset the board via the on-board reset pin\n# assembler\nenv.Replace(AS = 'arm-none-eabi-as')\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/nrf52840dk/SConscript",
"new_path": "bsp/boards/nrf52840dk/SConscript",
"diff": "@@ -9,15 +9,20 @@ Import('env')\nlocalEnv = env.Clone()\nsource = \\\n- Glob('sdk/modules/nrfx/mdk/gcc_startup_nrf52840.S') + \\\n- Glob('sdk/modules/nrfx/mdk/system_nrf52840.c') + \\\nGlob('sdk/components/boards/boards.c') + \\\n+ Glob('sdk/components/libraries/experimental_section_vars/*.c') + \\\n+ Glob('sdk/components/libraries/pwr_mgmt/*.c') + \\\n+ Glob('sdk/components/libraries/timer/app_timer.c') + \\\n+ Glob('sdk/components/libraries/uart/app_uart.c') + \\\n+ Glob('sdk/components/libraries/util/app_util_platform.c') + \\\n+ Glob('sdk/integration/nrfx/legacy/nrf_drv_uart.c') + \\\nGlob('sdk/modules/nrfx/drivers/src/nrfx_clock.c') + \\\nGlob('sdk/modules/nrfx/drivers/src/nrfx_power.c') + \\\nGlob('sdk/modules/nrfx/drivers/src/nrfx_spi.c') + \\\n- Glob('sdk/components/libraries/experimental_section_vars/*.c') + \\\n- Glob('sdk/components/libraries/pwr_mgmt/*.c') + \\\n- Glob('sdk/components/libraries/uart/*.c') + \\\n+ Glob('sdk/modules/nrfx/drivers/src/nrfx_rtc.c') + \\\n+ Glob('sdk/modules/nrfx/drivers/src/nrfx_uart.c') + \\\n+ Glob('sdk/modules/nrfx/mdk/gcc_startup_nrf52840.S') + \\\n+ Glob('sdk/modules/nrfx/mdk/system_nrf52840.c') + \\\nGlob('*.c')\nlocalEnv.Append(\n@@ -29,12 +34,15 @@ localEnv.Append(\nos.path.join('#','bsp','boards','nrf52840dk','sdk','components','drivers_nrf','nrf_soc_nosd'),\nos.path.join('#','bsp','boards','nrf52840dk','sdk','components','libraries','atomic'),\nos.path.join('#','bsp','boards','nrf52840dk','sdk','components','libraries','balloc'),\n+ os.path.join('#','bsp','boards','nrf52840dk','sdk','components','libraries','delay'),\nos.path.join('#','bsp','boards','nrf52840dk','sdk','components','libraries','experimental_log'),\nos.path.join('#','bsp','boards','nrf52840dk','sdk','components','libraries','experimental_log','src'),\nos.path.join('#','bsp','boards','nrf52840dk','sdk','components','libraries','experimental_memobj'),\nos.path.join('#','bsp','boards','nrf52840dk','sdk','components','libraries','experimental_section_vars'),\nos.path.join('#','bsp','boards','nrf52840dk','sdk','components','libraries','mutex'),\n+ os.path.join('#','bsp','boards','nrf52840dk','sdk','components','libraries','uart'),\nos.path.join('#','bsp','boards','nrf52840dk','sdk','components','libraries','util'),\n+ os.path.join('#','bsp','boards','nrf52840dk','sdk','integration','nrfx','legacy'),\nos.path.join('#','bsp','boards','nrf52840dk','sdk','modules','nrfx'),\nos.path.join('#','bsp','boards','nrf52840dk','sdk','modules','nrfx','drivers'),\nos.path.join('#','bsp','boards','nrf52840dk','sdk','modules','nrfx','drivers','include'),\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/nrf52840dk/app_config.h",
"new_path": "bsp/boards/nrf52840dk/app_config.h",
"diff": "#define NRFX_CLOCK_ENABLED 1\n// UART\n+#define UART_ENABLED 1\n#define UART_EASY_DMA_SUPPORT 0\n#define UART0_ENABLED 1\n#define UART0_CONFIG_USE_EASY_DMA 0\n+#define APP_UART_ENABLED 1\n+#define APP_UART_DRIVER_INSTANCE 0\n// SPI\n-//#define NRFX_SPI_ENABLED\n-//#define NRFX_SPI0_ENABLED\n-//#define NRFX_SPIM0_ENABLED\n-#define SPI_ENABLED 1\n-#define SPI0_ENABLED 1\n-#define SPI0_USE_EASY_DMA 0\n+#define SPI_ENABLED 1 // solely for legacy driver calls (if any)\n+#define SPI0_ENABLED 1 // solely for legacy driver calls (if any)\n+#define SPI0_USE_EASY_DMA 0 // solely for legacy driver calls (if any)\n+#define NRFX_SPI_ENABLED\n+#define NRFX_SPI0_ENABLED\n+#define NRFX_SPIM0_ENABLED\n// TIMER\n-#define TIMER_ENABLED 1\n-#define TIMER0_ENABLED 1\n-#define TIMER0_USE_EASY_DMA 0\n+// #define TIMER_ENABLED 1\n+// #define TIMER0_ENABLED 1\n+// #define TIMER0_USE_EASY_DMA 0\n+\n+// enable the app_timer library (based on RTC1 [Real Time Counter]) to be used as TIMER\n+#define APP_TIMER_ENABLED 1\n+// #define RTC0_ENABLED 1 // solely for legacy driver calls (if any)\n+// #define NRFX_RTC_ENABLED 1\n+// #define NRFX_RTC0_ENABLED 1\n// power management\n#define NRF_PWR_MGMT_ENABLED 1\n-\n#endif // BSP_NRF52480_SDK_CONFIG_H\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/nrf52840dk/board.c",
"new_path": "bsp/boards/nrf52840dk/board.c",
"diff": "#include \"board.h\"\n#include \"leds.h\"\n-// #include \"bsp_timer.h\"\n+// #include \"bsp_timer.h\" ///< OBSOLETE, use sctimer instead\n+#include \"sctimer.h\"\n// #include \"radiotimer.h\"\n#include \"debugpins.h\"\n#include \"uart.h\"\n@@ -70,11 +71,14 @@ void board_init(void)\nbutton_init();\nleds_init();\ndebugpins_init();\n-// bsp_timer_init();\n+// bsp_timer_init(); ///< OBSOLETE, use sctimer instead\n+ sctimer_init();\n// radiotimer_init();\n-// uart_init();\n+ uart_init();\n// radio_init();\n// spi_init();\n+\n+ uart_writeByte('S'); ///< DEBUG, REMOVE ME!\n}\n/**\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/nrf52840dk/board_info.h",
"new_path": "bsp/boards/nrf52840dk/board_info.h",
"diff": "//===== timer\n-#define PORT_TIMER_WIDTH uint16_t\n+#define PORT_TIMER_WIDTH uint32_t ///< actually, 24 bit\n#define PORT_RADIOTIMER_WIDTH uint32_t\n#define PORT_SIGNED_INT_WIDTH int32_t\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/nrf52840dk/uart.c",
"new_path": "bsp/boards/nrf52840dk/uart.c",
"diff": "@@ -56,11 +56,11 @@ void uart_init(void)\n{\n.rx_pin_no= RX_PIN_NUMBER,\n.tx_pin_no= TX_PIN_NUMBER,\n- .rts_pin_no= RTS_PIN_NUMBER,\n- .cts_pin_no= CTS_PIN_NUMBER,\n+ .rts_pin_no= RTS_PIN_NUMBER, // defaults to UART_PIN_DISCONNECTED\n+ .cts_pin_no= CTS_PIN_NUMBER, // defaults to UART_PIN_DISCONNECTED\n.baud_rate= UART_DEFAULT_CONFIG_BAUDRATE,\n.use_parity= (UART_DEFAULT_CONFIG_PARITY != 0) ? (true) : (false),\n- .flow_control= HWFC\n+ .flow_control= HWFC // defaults to false\n};\n// if UART cannot be initialized, blink error LED for 10s, and then reset\n@@ -118,6 +118,7 @@ void uart_event_handler(app_uart_evt_t * p_event)\nif ((p_event->evt_type == APP_UART_COMMUNICATION_ERROR) || (p_event->evt_type == APP_UART_FIFO_ERROR) || (p_event->evt_type == APP_UART_FIFO_ERROR))\n{\n// handle error ...\n+ leds_error_blink();\n}\nelse if ((p_event->evt_type == APP_UART_DATA) || (p_event->evt_type == APP_UART_DATA_READY))\n{\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
Added further ports. Timer implementation still seems to be buggy (02drv_opentimers project hangs after several minutes).
|
491,604 |
23.05.2018 16:14:55
| -7,200 |
7673b90e6c1a866777b7b701221ca93221a1fd2f
|
Changed SConscript
|
[
{
"change_type": "MODIFY",
"old_path": "SConscript",
"new_path": "SConscript",
"diff": "@@ -572,6 +572,12 @@ def jtagUploadFunc(location):\nsuffix = '.phonyupload',\nsrc_suffix = '.ihex',\n)\n+ if env['board']=='nrf52840dk':\n+ return Builder(\n+ action = os.path.join('bsp','boards',env['board'],'tools','flash.sh') + \" $SOURCE\",\n+ suffix = '.phonyupload',\n+ src_suffix = '.elf',\n+ )\nelse:\nif env['fet_version']==2:\n# MSP-FET430uif is running v2 Firmware\n@@ -855,9 +861,13 @@ if env['bootload']:\ndef extras(env, source):\nreturnVal = []\nreturnVal += [env.PrintSize(source=source)]\n+ if env['board'] != 'nrf52840dk':\nreturnVal += [env.Elf2iHex(source=source)]\nreturnVal += [env.Elf2iBin(source=source)]\nif env['jtag']:\n+ if env['board'] == 'nrf52840dk' and env['jtag'] == 'bflash':\n+ returnVal += [env.JtagUpload(source)]\n+ else:\nreturnVal += [env.JtagUpload(env.Elf2iHex(source))]\nelif env['bootload']:\nreturnVal += [env.Bootload(env.Elf2iHex(source))]\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
Changed SConscript
|
491,604 |
24.05.2018 16:04:20
| -7,200 |
29ceb0739573a01c99ef8584bcc9137cc0fbcfd3
|
Added SPI functionality
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/nrf52840dk/board.c",
"new_path": "bsp/boards/nrf52840dk/board.c",
"diff": "@@ -76,7 +76,7 @@ void board_init(void)\n// radiotimer_init();\nuart_init();\n// radio_init();\n-// spi_init();\n+ spi_init();\nuart_writeByte('S'); ///< DEBUG, REMOVE ME!\n}\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "projects/common/01bsp_spi2/01bsp_spi2.c",
"diff": "+/**\n+\\brief This program shows the use of the \"spi\" bsp module.\n+\n+Since the bsp modules for different platforms have the same declaration, you\n+can use this project with any platform.\n+\n+This program was written to communicate with the AT86RF231 radio chip. It will\n+run regardless of your radio, but might not return anything useful.\n+\n+\\author Thomas Watteyne <watteyne@eecs.berkeley.edu>, August 2014.\n+*/\n+\n+#include \"stdint.h\"\n+#include \"stdio.h\"\n+#include \"string.h\"\n+\n+#include \"board.h\"\n+#include \"spi.h\"\n+#include \"uart.h\"\n+#include \"sctimer.h\"\n+#include \"leds.h\"\n+\n+//=========================== defines =========================================\n+\n+#define SCTIMER_PERIOD 0xffff // 0xffff@32kHz = 2s\n+uint8_t stringToSend[] = \"Hello, World!\\r\\n\";\n+\n+//=========================== variables =======================================\n+\n+typedef struct {\n+ uint8_t txBuf[3];\n+ uint8_t rxBuf[3];\n+} app_vars_spi_t;\n+\n+app_vars_spi_t app_vars_spi;\n+\n+typedef struct {\n+ uint8_t uart_lastTxByteIndex;\n+ volatile uint8_t uartDone;\n+ volatile uint8_t uartSendNow;\n+} app_vars_uart_t;\n+\n+app_vars_uart_t app_vars_uart;\n+\n+\n+//=========================== prototypes ======================================\n+\n+void cb_compare(void);\n+void cb_uartTxDone(void);\n+void cb_uartRxCb(void);\n+\n+//=========================== main ============================================\n+\n+/**\n+\\brief The program starts executing here.\n+*/\n+int mote_main(void) {\n+\n+ memset(&app_vars_spi,0,sizeof(app_vars_spi_t));\n+ memset(&app_vars_uart,0,sizeof(app_vars_uart_t));\n+\n+ app_vars_uart.uartSendNow = 1;\n+\n+ // initialize\n+\n+ board_init();\n+\n+ // setup UART\n+ uart_setCallbacks(cb_uartTxDone,cb_uartRxCb);\n+ uart_enableInterrupts();\n+\n+ // setup sctimer\n+ sctimer_set_callback(cb_compare);\n+ sctimer_setCompare(sctimer_readCounter()+SCTIMER_PERIOD);\n+\n+ // prepare buffer to send over SPI\n+ app_vars_spi.txBuf[0] = (0x80 | 0x1E); // [b7] Read/Write: 1 (read)\n+ // [b6] RAM/Register : 0 (register)\n+ // [b5-0] address: 0x1E (Manufacturer ID, Lower 16 Bit)\n+ app_vars_spi.txBuf[1] = 0x00; // send a SNOP strobe just to get the reg value\n+ app_vars_spi.txBuf[2] = 0x00; // send a SNOP strobe just to get the reg value\n+\n+ // retrieve radio manufacturer ID over SPI\n+ while(1) {\n+ spi_txrx(\n+ app_vars_spi.txBuf,\n+ sizeof(app_vars_spi.txBuf),\n+ SPI_BUFFER,\n+ app_vars_spi.rxBuf,\n+ sizeof(app_vars_spi.rxBuf),\n+ SPI_FIRST,\n+ SPI_LAST\n+ );\n+\n+ // wait for timer to elapse\n+ while (app_vars_uart.uartSendNow==0);\n+ app_vars_uart.uartSendNow = 0;\n+\n+ // send string over UART\n+ app_vars_uart.uartDone = 0;\n+ app_vars_uart.uart_lastTxByteIndex = 0;\n+ uart_writeByte(app_vars_spi.rxBuf[app_vars_uart.uart_lastTxByteIndex]);\n+ while(app_vars_uart.uartDone==0);\n+ }\n+}\n+\n+\n+//=========================== callbacks =======================================\n+\n+void cb_compare(void) {\n+\n+ // have main \"task\" send over UART\n+ app_vars_uart.uartSendNow = 1;\n+\n+ // schedule again\n+ sctimer_setCompare(sctimer_readCounter()+SCTIMER_PERIOD);\n+}\n+\n+void cb_uartTxDone(void) {\n+ app_vars_uart.uart_lastTxByteIndex++;\n+ if (app_vars_uart.uart_lastTxByteIndex<sizeof(stringToSend)) {\n+ uart_writeByte(app_vars_spi.rxBuf[app_vars_uart.uart_lastTxByteIndex]);\n+ } else {\n+ app_vars_uart.uartDone = 1;\n+ }\n+}\n+\n+void cb_uartRxCb(void) {\n+ uint8_t byte;\n+\n+ // toggle LED\n+ leds_error_toggle();\n+\n+ // read received byte\n+ byte = uart_readByte();\n+\n+ // echo that byte over serial\n+ uart_writeByte(byte);\n+}\n\\ No newline at end of file\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
Added SPI functionality
|
491,604 |
25.05.2018 09:52:40
| -7,200 |
2a6a242ff77ee11d953da2b518084b4f8a77ea34
|
Initial radio source added
|
[
{
"change_type": "ADD",
"old_path": null,
"new_path": "bsp/boards/nrf52840dk/radio.c",
"diff": "+/**\n+ * Author: Xavier Vilajosana (xvilajosana@eecs.berkeley.edu)\n+ * Pere Tuset (peretuset@openmote.com)\n+ * Date: July 2013\n+ * Description: CC2538-specific definition of the \"radio\" bsp module.\n+ */\n+\n+#include <stdio.h>\n+#include <stdint.h>\n+#include <string.h>\n+\n+#include \"sdk/components/boards/pca10056.h\"\n+#include \"sdk/components/boards/boards.h\"\n+\n+#include \"app_config.h\"\n+#include \"leds.h\"\n+#include \"radio.h\"\n+#include \"board.h\"\n+#include \"board_info.h\"\n+#include \"debugpins.h\"\n+\n+//=========================== defines =========================================\n+\n+/* Bit Masks for the last byte in the RX FIFO */\n+//#define CRC_BIT_MASK 0x80\n+//#define LQI_BIT_MASK 0x7F\n+\n+/* RSSI Offset */\n+//#define RSSI_OFFSET 73\n+//#define CHECKSUM_LEN 2\n+\n+//=========================== variables =======================================\n+\n+typedef struct {\n+ radio_capture_cbt startFrame_cb;\n+ radio_capture_cbt endFrame_cb;\n+ radio_state_t state;\n+} radio_vars_t;\n+\n+radio_vars_t radio_vars;\n+\n+//=========================== prototypes ======================================\n+\n+//=========================== public ==========================================\n+\n+//===== admin\n+\n+void radio_init(void) {\n+\n+ // clear variables\n+ memset(&radio_vars,0,sizeof(radio_vars_t));\n+\n+}\n+\n+void radio_setStartFrameCb(radio_capture_cbt cb) {\n+ radio_vars.startFrame_cb = cb;\n+}\n+\n+void radio_setEndFrameCb(radio_capture_cbt cb) {\n+ radio_vars.endFrame_cb = cb;\n+}\n+\n+//===== reset\n+\n+void radio_reset(void) {\n+}\n+\n+//===== RF admin\n+\n+void radio_setFrequency(uint8_t frequency) {\n+\n+\n+}\n+\n+void radio_rfOn(void) {\n+ //radio_on();\n+}\n+\n+void radio_rfOff(void) {\n+\n+}\n+\n+//===== TX\n+\n+void radio_loadPacket(uint8_t* packet, uint16_t len) {\n+\n+}\n+\n+void radio_txEnable(void) {\n+\n+}\n+\n+void radio_txNow(void) {\n+\n+}\n+\n+//===== RX\n+\n+void radio_rxEnable(void) {\n+\n+\n+}\n+\n+void radio_rxNow(void) {\n+\n+}\n+\n+void radio_getReceivedFrame(uint8_t* pBufRead,\n+ uint8_t* pLenRead,\n+ uint8_t maxBufLen,\n+ int8_t* pRssi,\n+ uint8_t* pLqi,\n+ bool* pCrc) {\n+\n+}\n+\n+//=========================== private =========================================\n+\n+//=========================== callbacks =======================================\n+\n+//=========================== interrupt handlers ==============================\n+\n+kick_scheduler_t radio_isr(void) {\n+ return DO_NOT_KICK_SCHEDULER;\n+}\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
Initial radio source added
|
491,605 |
29.05.2018 16:16:28
| -7,200 |
dde2e8369660e03bee9c156d09db781e7cb8e231
|
sctimer working quite good (still needs more testing and benchmarking)
ihex file generation enabled again
|
[
{
"change_type": "DELETE",
"old_path": ".vscode/c_cpp_properties.json",
"new_path": null,
"diff": "-{\n- \"configurations\": [\n- {\n- \"name\": \"Mac\",\n- \"includePath\": [\n- \"/usr/include\",\n- \"/usr/local/include\",\n- \"${workspaceFolder}\"\n- ],\n- \"defines\": [],\n- \"intelliSenseMode\": \"clang-x64\",\n- \"browse\": {\n- \"path\": [\n- \"/usr/include\",\n- \"/usr/local/include\",\n- \"${workspaceFolder}\"\n- ],\n- \"limitSymbolsToIncludedHeaders\": true,\n- \"databaseFilename\": \"\"\n- },\n- \"macFrameworkPath\": [\n- \"/System/Library/Frameworks\",\n- \"/Library/Frameworks\"\n- ]\n- },\n- {\n- \"name\": \"Linux\",\n- \"includePath\": [\n- \"/usr/include\",\n- \"/usr/local/include\",\n- \"${workspaceFolder}\"\n- ],\n- \"defines\": [],\n- \"intelliSenseMode\": \"clang-x64\",\n- \"browse\": {\n- \"path\": [\n- \"/usr/include\",\n- \"/usr/local/include\",\n- \"${workspaceFolder}\"\n- ],\n- \"limitSymbolsToIncludedHeaders\": true,\n- \"databaseFilename\": \"\"\n- }\n- },\n- {\n- \"name\": \"Win32\",\n- \"includePath\": [\n- \"${workspaceFolder}/bsp/boards/nrf52840dk/sdk/modules/nrfx\",\n- \"${workspaceFolder}/bsp/boards/nrf52840dk/sdk/components/toolchain/cmsis/include\",\n- \"${workspaceFolder}/bsp/boards/nrf52840dk/sdk/integration/nrfx\",\n- \"${workspaceFolder}/bsp/boards/nrf52840dk/sdk/modules/nrfx/hal\",\n- \"${workspaceFolder}/bsp/boards/nrf52840dk/sdk/config/nrf52840/config\",\n- \"${workspaceFolder}/bsp/boards/nrf52840dk/sdk/components/libraries/util\",\n- \"${workspaceFolder}/bsp/boards/nrf52840dk/sdk/components/libraries/uart\"\n- ],\n- \"defines\": [\n- \"_DEBUG\",\n- \"UNICODE\",\n- \"_UNICODE\"\n- ],\n- \"intelliSenseMode\": \"msvc-x64\",\n- \"browse\": {\n- \"path\": [\n- \"${workspaceFolder}\"\n- ],\n- \"limitSymbolsToIncludedHeaders\": true,\n- \"databaseFilename\": \"\"\n- },\n- \"cStandard\": \"c11\",\n- \"cppStandard\": \"c++17\"\n- }\n- ],\n- \"version\": 3\n-}\n\\ No newline at end of file\n"
},
{
"change_type": "DELETE",
"old_path": ".vscode/settings.json",
"new_path": null,
"diff": "-{\n- \"files.associations\": {\n- \"nrfx_clock.h\": \"c\",\n- \"nrf52840.h\": \"c\",\n- \"nrf_pwr_mgmt.h\": \"c\",\n- \"app_uart.h\": \"c\"\n- }\n-}\n\\ No newline at end of file\n"
},
{
"change_type": "MODIFY",
"old_path": "SConscript",
"new_path": "SConscript",
"diff": "@@ -862,8 +862,8 @@ if env['bootload']:\ndef extras(env, source):\nreturnVal = []\nreturnVal += [env.PrintSize(source=source)]\n- if env['board'] != 'nrf52840dk':\nreturnVal += [env.Elf2iHex(source=source)]\n+ if env['board'] != 'nrf52840dk':\nreturnVal += [env.Elf2iBin(source=source)]\nif env['jtag']:\nif env['board'] == 'nrf52840dk' and env['jtag'] == 'bflash':\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/nrf52840dk/SConscript",
"new_path": "bsp/boards/nrf52840dk/SConscript",
"diff": "@@ -12,14 +12,13 @@ source = \\\nGlob('sdk/components/boards/boards.c') + \\\nGlob('sdk/components/libraries/experimental_section_vars/*.c') + \\\nGlob('sdk/components/libraries/pwr_mgmt/*.c') + \\\n- Glob('sdk/components/libraries/timer/app_timer.c') + \\\nGlob('sdk/components/libraries/uart/app_uart.c') + \\\nGlob('sdk/components/libraries/util/app_util_platform.c') + \\\nGlob('sdk/integration/nrfx/legacy/nrf_drv_uart.c') + \\\nGlob('sdk/modules/nrfx/drivers/src/nrfx_clock.c') + \\\nGlob('sdk/modules/nrfx/drivers/src/nrfx_power.c') + \\\n- Glob('sdk/modules/nrfx/drivers/src/nrfx_spi.c') + \\\nGlob('sdk/modules/nrfx/drivers/src/nrfx_rtc.c') + \\\n+ Glob('sdk/modules/nrfx/drivers/src/nrfx_spi.c') + \\\nGlob('sdk/modules/nrfx/drivers/src/nrfx_uart.c') + \\\nGlob('sdk/modules/nrfx/mdk/gcc_startup_nrf52840.S') + \\\nGlob('sdk/modules/nrfx/mdk/system_nrf52840.c') + \\\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/nrf52840dk/app_config.h",
"new_path": "bsp/boards/nrf52840dk/app_config.h",
"diff": "// #define TIMER0_USE_EASY_DMA 0\n// enable the app_timer library (based on RTC1 [Real Time Counter]) to be used as TIMER\n-#define APP_TIMER_ENABLED 1\n-// #define RTC0_ENABLED 1 // solely for legacy driver calls (if any)\n-// #define NRFX_RTC_ENABLED 1\n-// #define NRFX_RTC0_ENABLED 1\n+// #define APP_TIMER_ENABLED 1\n+#define RTC_ENABLED 1 // solely for legacy driver calls (if any)\n+#define RTC0_ENABLED 1 // solely for legacy driver calls (if any)\n+#define NRFX_RTC_ENABLED 1\n+#define NRFX_RTC0_ENABLED 1\n// power management\n#define NRF_PWR_MGMT_ENABLED 1\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/nrf52840dk/board.c",
"new_path": "bsp/boards/nrf52840dk/board.c",
"diff": "#include \"sdk/modules/nrfx/hal/nrf_power.h\"\n#include \"sdk/modules/nrfx/drivers/include/nrfx_clock.h\"\n#include \"sdk/components/libraries/pwr_mgmt/nrf_pwr_mgmt.h\"\n+#include \"sdk/components/libraries/delay/nrf_delay.h\"\n#include \"sdk/modules/nrfx/mdk/nrf52840.h\"\n#include \"sdk/modules/nrfx/drivers/nrfx_common.h\"\n@@ -67,18 +68,28 @@ void board_init(void)\n// initialize boards with LEDs and buttons\nbsp_board_init(BSP_INIT_LEDS | BSP_INIT_BUTTONS);\n+ uart_init(); ///< we can use the UART for simple debugging\nbutton_init();\n+\nleds_init();\n+ uart_writeByte('L'); nrf_delay_ms(10); ///< DEBUG, REMOVE ME!\n+ uart_writeByte(48+LEDS_NUMBER); nrf_delay_ms(10);\n+\ndebugpins_init();\n+ uart_writeByte('D'); nrf_delay_ms(10); ///< DEBUG, REMOVE ME!\n+\n// bsp_timer_init(); ///< OBSOLETE, use sctimer instead\nsctimer_init();\n+ uart_writeByte('T'); nrf_delay_ms(10); ///< DEBUG, REMOVE ME!\n+\n// radiotimer_init();\n- uart_init();\n// radio_init();\n+\nspi_init();\n+ uart_writeByte('S'); nrf_delay_ms(10); ///< DEBUG, REMOVE ME!\n- uart_writeByte('S'); ///< DEBUG, REMOVE ME!\n+ uart_writeByte('~'); ///< DEBUG, REMOVE ME!\n}\n/**\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/nrf52840dk/board_info.h",
"new_path": "bsp/boards/nrf52840dk/board_info.h",
"diff": "#include <string.h>\n#include \"sdk/modules/nrfx/templates/nRF52840/nrfx_config.h\"\n+// #include \"sdk/components/toolchain/cmsis/include/core_cmFunc.h\"\n#include \"opendefs.h\"\n+\n//=========================== defines =========================================\n//===== interrupt state\n#define INTERRUPT_DECLARATION()\n-#define DISABLE_INTERRUPTS() IntMasterDisable()\n-\n-#define ENABLE_INTERRUPTS() IntMasterEnable()\n+#define DISABLE_INTERRUPTS() __asm volatile (\"cpsid i\" : : : \"memory\") ///< or use __disable_irq() from core_cmFunc.h\n+#define ENABLE_INTERRUPTS() __asm volatile (\"cpsie i\" : : : \"memory\") ///< or use __enable_irq() from core_cmFunc.h\n//===== timer\n-#define PORT_TIMER_WIDTH uint32_t ///< actually, 24 bit\n+#define PORT_TIMER_WIDTH uint32_t ///< actually, 24 bit, but we will virtualize the 32 bit timer\n#define PORT_RADIOTIMER_WIDTH uint32_t\n#define PORT_SIGNED_INT_WIDTH int32_t\n"
},
{
"change_type": "DELETE",
"old_path": "projects/common/01bsp_sctimer/01bsp_sctimer.c",
"new_path": null,
"diff": "-/**\n-\\brief This program shows the use of the \"sctimer\" bsp module.\n-\n-Since the bsp modules for different platforms have the same declaration, you\n-can use this project with any platform.\n-\n-Load this program onto your board, and start running. It will enable the sctimer.\n-The sctimer is periodic, of period SCTIMER_PERIOD ticks. Each time it elapses:\n- - the frame debugpin toggles\n- - the error LED toggles\n-\n-\\author Tengfei Chang <tengfei.chang@eecs.berkeley.edu>, April 2017.\n-*/\n-\n-#include \"stdint.h\"\n-#include \"string.h\"\n-#include \"board.h\"\n-#include \"debugpins.h\"\n-#include \"leds.h\"\n-#include \"sctimer.h\"\n-\n-//=========================== defines =========================================\n-\n-#define SCTIMER_PERIOD 32768 // @32kHz = 1s\n-\n-//=========================== variables =======================================\n-\n-typedef struct {\n- uint16_t num_compare;\n-} app_vars_t;\n-\n-app_vars_t app_vars;\n-\n-//=========================== prototypes ======================================\n-\n-void cb_compare(void);\n-\n-//=========================== main ============================================\n-\n-/**\n-\\brief The program starts executing here.\n-*/\n-int mote_main(void) {\n-\n- // initialize board.\n- board_init();\n-\n- sctimer_set_callback(cb_compare);\n- sctimer_setCompare(sctimer_readCounter()+SCTIMER_PERIOD);\n-\n- while (1) {\n- board_sleep();\n- }\n-}\n-\n-//=========================== callbacks =======================================\n-\n-void cb_compare(void) {\n-\n- // toggle pin\n- debugpins_frame_toggle();\n-\n- // toggle error led\n- leds_error_toggle();\n-\n- // increment counter\n- app_vars.num_compare++;\n-\n- // schedule again\n- sctimer_setCompare(sctimer_readCounter()+SCTIMER_PERIOD);\n-}\n"
},
{
"change_type": "DELETE",
"old_path": "projects/common/02drv_opentimers/02drv_opentimers.c",
"new_path": null,
"diff": "-/**\n-\\brief This is a program which shows how to use the \"opentimers\" driver module.\n-\n-Since the driver modules for different platforms have the same declaration, you\n-can use this project with any platform.\n-\n-This application allows you to verify the correct functioning of the opentimers\n-drivers. It starts 3 periodic timers, with periods TIMER0_PERIOD_MS,\n-TIMER1_PERIOD_MS and TIMER2_PERIOD_MS. Each timer is attached an LED (error,\n-sync, debug, respec.).\n-\n-When you run the application, you should see the LEDs \"counting\".\n-\n-\\author Thomas Watteyne <thomas.watteyne@inria.fr>, July 2017.\n-*/\n-\n-#include \"stdint.h\"\n-#include \"stdio.h\"\n-// bsp modules required\n-#include \"board.h\"\n-#include \"leds.h\"\n-// driver modules required\n-#include \"opentimers.h\"\n-\n-//=========================== defines =========================================\n-\n-#define TIMER0_PERIOD_MS 400\n-#define TIMER1_PERIOD_MS 800\n-#define TIMER2_PERIOD_MS 1600\n-\n-//=========================== variables =======================================\n-\n-typedef struct {\n- opentimers_id_t timer0_id;\n- opentimers_id_t timer1_id;\n- opentimers_id_t timer2_id;\n-} app_vars_t;\n-\n-app_vars_t app_vars;\n-\n-//=========================== prototypes ======================================\n-\n-void timer0_cb(opentimers_id_t id);\n-void timer1_cb(opentimers_id_t id);\n-void timer2_cb(opentimers_id_t id);\n-\n-//=========================== main ============================================\n-\n-/**\n-\\brief The program starts executing here.\n-*/\n-int mote_main(void) {\n-\n- memset(&app_vars,0,sizeof(app_vars_t));\n-\n- board_init();\n- opentimers_init();\n-\n- app_vars.timer0_id = opentimers_create();\n- opentimers_scheduleIn (\n- app_vars.timer0_id, // id\n- TIMER0_PERIOD_MS, // duration\n- TIME_MS, // time_type\n- TIMER_PERIODIC, // timer_type\n- timer0_cb // callback\n- );\n-\n- app_vars.timer1_id = opentimers_create();\n- opentimers_scheduleIn (\n- app_vars.timer1_id, // id\n- TIMER1_PERIOD_MS, // duration\n- TIME_MS, // time_type\n- TIMER_PERIODIC, // timer_type\n- timer1_cb // callback\n- );\n-\n- app_vars.timer2_id = opentimers_create();\n- opentimers_scheduleIn (\n- app_vars.timer2_id, // id\n- TIMER2_PERIOD_MS, // duration\n- TIME_MS, // time_type\n- TIMER_PERIODIC, // timer_type\n- timer2_cb // callback\n- );\n-\n- while(1) {\n- board_sleep();\n- }\n-}\n-\n-//=========================== callbacks =======================================\n-\n-void timer0_cb(opentimers_id_t id) {\n- leds_error_toggle();\n-}\n-\n-void timer1_cb(opentimers_id_t id) {\n- leds_sync_toggle();\n-}\n-\n-void timer2_cb(opentimers_id_t id) {\n- leds_debug_toggle();\n-}\n-\n-//=========================== stub functions ==================================\n-\n-void sniffer_setListeningChannel(void){}\n\\ No newline at end of file\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
sctimer working quite good (still needs more testing and benchmarking)
ihex file generation enabled again
|
491,605 |
29.05.2018 16:22:27
| -7,200 |
4904a49e0bb1b59273d2d2e988e6361900a11210
|
Re-added sctimer and opentimers test projects, which were accidentally removed.
|
[
{
"change_type": "ADD",
"old_path": null,
"new_path": "projects/common/01bsp_sctimer/01bsp_sctimer.c",
"diff": "+/**\n+\\brief This program shows the use of the \"sctimer\" bsp module.\n+\n+Since the bsp modules for different platforms have the same declaration, you\n+can use this project with any platform.\n+\n+Load this program onto your board, and start running. It will enable the sctimer.\n+The sctimer is periodic, of period SCTIMER_PERIOD ticks. Each time it elapses:\n+ - the frame debugpin toggles\n+ - the error LED toggles\n+\n+\\author Tengfei Chang <tengfei.chang@eecs.berkeley.edu>, April 2017.\n+*/\n+\n+#include \"stdint.h\"\n+#include \"string.h\"\n+#include \"board.h\"\n+#include \"debugpins.h\"\n+#include \"leds.h\"\n+#include \"sctimer.h\"\n+\n+//=========================== defines =========================================\n+\n+#define SCTIMER_PERIOD 32768 // @32kHz = 1s\n+\n+//=========================== variables =======================================\n+\n+typedef struct {\n+ uint16_t num_compare;\n+} app_vars_t;\n+\n+app_vars_t app_vars;\n+\n+//=========================== prototypes ======================================\n+\n+void cb_compare(void);\n+\n+//=========================== main ============================================\n+\n+/**\n+\\brief The program starts executing here.\n+*/\n+int mote_main(void) {\n+\n+ // initialize board.\n+ board_init();\n+\n+ sctimer_set_callback(cb_compare);\n+ sctimer_setCompare(sctimer_readCounter()+SCTIMER_PERIOD);\n+\n+ while (1) {\n+ board_sleep();\n+ }\n+}\n+\n+//=========================== callbacks =======================================\n+\n+void cb_compare(void) {\n+\n+ // toggle pin\n+ debugpins_frame_toggle();\n+\n+ // toggle error led\n+ leds_error_toggle();\n+\n+ // increment counter\n+ app_vars.num_compare++;\n+\n+ // schedule again\n+ sctimer_setCompare(sctimer_readCounter()+SCTIMER_PERIOD);\n+}\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "projects/common/02drv_opentimers/02drv_opentimers.c",
"diff": "+/**\n+\\brief This is a program which shows how to use the \"opentimers\" driver module.\n+\n+Since the driver modules for different platforms have the same declaration, you\n+can use this project with any platform.\n+\n+This application allows you to verify the correct functioning of the opentimers\n+drivers. It starts 3 periodic timers, with periods TIMER0_PERIOD_MS,\n+TIMER1_PERIOD_MS and TIMER2_PERIOD_MS. Each timer is attached an LED (error,\n+sync, debug, respec.).\n+\n+When you run the application, you should see the LEDs \"counting\".\n+\n+\\author Thomas Watteyne <thomas.watteyne@inria.fr>, July 2017.\n+*/\n+\n+#include \"stdint.h\"\n+#include \"stdio.h\"\n+// bsp modules required\n+#include \"board.h\"\n+#include \"leds.h\"\n+// driver modules required\n+#include \"opentimers.h\"\n+\n+//=========================== defines =========================================\n+\n+#define TIMER0_PERIOD_MS 400\n+#define TIMER1_PERIOD_MS 800\n+#define TIMER2_PERIOD_MS 1600\n+\n+//=========================== variables =======================================\n+\n+typedef struct {\n+ opentimers_id_t timer0_id;\n+ opentimers_id_t timer1_id;\n+ opentimers_id_t timer2_id;\n+} app_vars_t;\n+\n+app_vars_t app_vars;\n+\n+//=========================== prototypes ======================================\n+\n+void timer0_cb(opentimers_id_t id);\n+void timer1_cb(opentimers_id_t id);\n+void timer2_cb(opentimers_id_t id);\n+\n+//=========================== main ============================================\n+\n+/**\n+\\brief The program starts executing here.\n+*/\n+int mote_main(void) {\n+\n+ memset(&app_vars,0,sizeof(app_vars_t));\n+\n+ board_init();\n+ opentimers_init();\n+\n+ app_vars.timer0_id = opentimers_create();\n+ opentimers_scheduleIn (\n+ app_vars.timer0_id, // id\n+ TIMER0_PERIOD_MS, // duration\n+ TIME_MS, // time_type\n+ TIMER_PERIODIC, // timer_type\n+ timer0_cb // callback\n+ );\n+\n+ app_vars.timer1_id = opentimers_create();\n+ opentimers_scheduleIn (\n+ app_vars.timer1_id, // id\n+ TIMER1_PERIOD_MS, // duration\n+ TIME_MS, // time_type\n+ TIMER_PERIODIC, // timer_type\n+ timer1_cb // callback\n+ );\n+\n+ app_vars.timer2_id = opentimers_create();\n+ opentimers_scheduleIn (\n+ app_vars.timer2_id, // id\n+ TIMER2_PERIOD_MS, // duration\n+ TIME_MS, // time_type\n+ TIMER_PERIODIC, // timer_type\n+ timer2_cb // callback\n+ );\n+\n+ while(1) {\n+ board_sleep();\n+ }\n+}\n+\n+//=========================== callbacks =======================================\n+\n+void timer0_cb(opentimers_id_t id) {\n+ leds_error_toggle();\n+}\n+\n+void timer1_cb(opentimers_id_t id) {\n+ leds_sync_toggle();\n+}\n+\n+void timer2_cb(opentimers_id_t id) {\n+ leds_debug_toggle();\n+}\n+\n+//=========================== stub functions ==================================\n+\n+void sniffer_setListeningChannel(void){}\n\\ No newline at end of file\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
Re-added sctimer and opentimers test projects, which were accidentally removed.
|
491,605 |
30.05.2018 09:40:31
| -7,200 |
3fed615b91c0a460650a146bb079e010dba986d1
|
sctimer implementation revisited, now it should be safe to use
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/nrf52840dk/sctimer.c",
"new_path": "bsp/boards/nrf52840dk/sctimer.c",
"diff": "#include \"board.h\"\n#include \"leds.h\"\n#include \"debugpins.h\"\n-#include \"uart.h\" ///< for debuggin only, REMOVE ME\n// ========================== define ==========================================\n#define MINIMUM_COMPAREVALE_ADVANCE 5\n-#define MAX_RTC_TASKS_DELAY 153 // Maximum delay in us until an RTC task is executed\n+#define COMPAREVALE_ADVANCE_STEP 2\n+#define MAX_RTC_TASKS_DELAY 47 // maximum delay in us until an RTC config task is executed\n#define CC_TIMER 0 // CC channel used for the timer's compare value\n@@ -63,16 +63,15 @@ void sctimer_init(void)\nnrfx_rtc_config_t const rtc_cfg=\n{\n.prescaler= RTC_FREQ_TO_PRESCALER(NRFX_RTC_DEFAULT_CONFIG_FREQUENCY),\n- .interrupt_priority= 2, // NRFX_RTC_DEFAULT_CONFIG_IRQ_PRIORITY,\n+ .interrupt_priority= NRFX_RTC_DEFAULT_CONFIG_IRQ_PRIORITY,\n.tick_latency= NRFX_RTC_US_TO_TICKS(NRFX_RTC_MAXIMUM_LATENCY_US, NRFX_RTC_DEFAULT_CONFIG_FREQUENCY),\n- .reliable= NRFX_RTC_DEFAULT_CONFIG_RELIABLE\n+ .reliable= 1 // NRFX_RTC_DEFAULT_CONFIG_RELIABLE\n};\n// initialize RTC, we use the 32768 Hz clock without prescaler\nretVal= nrfx_rtc_init(&m_timer, &rtc_cfg, timer_event_handler);\nif (NRFX_SUCCESS != retVal)\n{\n- uart_writeByte(retVal); ///< DEBUG ONLY, REMOVE ME!\nleds_error_blink();\nboard_reset();\n}\n@@ -111,9 +110,22 @@ void sctimer_setCompare(PORT_TIMER_WIDTH val)\n{\nnrfx_err_t retVal= NRFX_SUCCESS;\n- uint32_t counter_current= sctimer_readCounter();\n+ // make sure that no other CC match event will interrupt this block\n+ uint32_t int_mask= RTC_CHANNEL_INT_MASK(CC_TIMER);\n+ nrf_rtc_event_t event= RTC_CHANNEL_EVENT_ADDR(CC_TIMER);\n+ nrf_rtc_event_disable(m_timer.p_reg, int_mask);\n+ nrf_rtc_int_disable(m_timer.p_reg, int_mask);\n+\n+ uint32_t counter_current;\nuint32_t counter_distance, counter_demanded;\n+ uint8_t restart_count= 0;\n+ uint8_t const max_restart_count= 3;\n+\n+restart:\n+\n+ counter_current= sctimer_readCounter();\n+\nif (val >= counter_current)\n{\ncounter_distance= val - counter_current;\n@@ -142,12 +154,25 @@ void sctimer_setCompare(PORT_TIMER_WIDTH val)\nsctimer_vars.cc32bit_MSB= counter_demanded & 0xFF000000;\n// set 3 LSBs of CC\n- retVal= nrfx_rtc_cc_set(&m_timer, CC_TIMER, counter_demanded & 0x00FFFFFF, true);\n- nrf_delay_us(MAX_RTC_TASKS_DELAY);\n+ retVal= nrfx_rtc_cc_set(&m_timer, CC_TIMER, counter_demanded & 0x00FFFFFF, false);\n+ // nrf_delay_us(MAX_RTC_TASKS_DELAY);\n+\n+ // nrfx_rtc_cc_set() will return NRFX_ERROR_TIMEOUT if the demanded CC value cannot be safely made by the timer.\n+ // In that case, we reschedule the next event.\n+ if ((NRFX_ERROR_TIMEOUT == retVal) && (restart_count < max_restart_count))\n+ {\n+ val += COMPAREVALE_ADVANCE_STEP;\n+ restart_count++;\n+ goto restart;\n+ }\n+\n+ // re-enable CC event and interrupt\n+ nrf_rtc_event_clear(m_timer.p_reg,event);\n+ nrf_rtc_int_enable(m_timer.p_reg, int_mask);\n+ nrf_rtc_event_enable(m_timer.p_reg,int_mask);\nif (retVal != NRFX_SUCCESS)\n{\n- uart_writeByte(retVal); ///< DEBUG, REMOVE ME!\nleds_error_blink();\nboard_reset();\n}\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
sctimer implementation revisited, now it should be safe to use
|
491,604 |
01.06.2018 14:42:33
| -7,200 |
3295a249a43f079e48bfe85f8120e87bc3638335
|
Early development stage for radio
|
[
{
"change_type": "ADD",
"old_path": null,
"new_path": "bsp/boards/nrf52840dk/eui64.c",
"diff": "+/**\n+\\brief nrf52840dk-specific definition of the \"eui64\" bsp module.\n+\n+ * Author: Adam Sedmak (adam.sedmak@gmail.com)\n+ * Company: Faculty of Electronics and Computing, Zagreb, Croatia\n+ * Date: May 2018\n+*/\n+\n+#include \"string.h\"\n+#include \"eui64.h\"\n+\n+//=========================== defines =========================================\n+\n+//=========================== variables =======================================\n+\n+//=========================== prototypes ======================================\n+\n+//=========================== public ==========================================\n+\n+void eui64_get(uint8_t* addressToWrite) {\n+\n+}\n+\n+//=========================== private =========================================\n\\ No newline at end of file\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/nrf52840dk/radio.c",
"new_path": "bsp/boards/nrf52840dk/radio.c",
"diff": "#include <stdio.h>\n#include <stdint.h>\n#include <string.h>\n+#include <stdbool.h>\n#include \"sdk/components/boards/pca10056.h\"\n#include \"sdk/components/boards/boards.h\"\n+#include \"sdk/components/drivers_nrf/radio_config/radio_config.h\"\n+#include \"sdk/modules/nrfx/mdk/nrf52840.h\"\n#include \"app_config.h\"\n#include \"leds.h\"\n#include \"board.h\"\n#include \"board_info.h\"\n#include \"debugpins.h\"\n+#include \"sctimer.h\"\n//=========================== defines =========================================\n//=========================== variables =======================================\n+bool radio_on;\n+\ntypedef struct {\nradio_capture_cbt startFrame_cb;\nradio_capture_cbt endFrame_cb;\n@@ -50,6 +56,10 @@ void radio_init(void) {\n// clear variables\nmemset(&radio_vars,0,sizeof(radio_vars_t));\n+ radio_configure();\n+\n+ radio_on = true;\n+\n}\nvoid radio_setStartFrameCb(radio_capture_cbt cb) {\n@@ -63,13 +73,19 @@ void radio_setEndFrameCb(radio_capture_cbt cb) {\n//===== reset\nvoid radio_reset(void) {\n+\n+\n}\n//===== RF admin\nvoid radio_setFrequency(uint8_t frequency) {\n+ radio_vars.state = RADIOSTATE_SETTING_FREQUENCY;\n+\n+ NRF_RADIO->FREQUENCY = frequency;\n+ radio_vars.state = RADIOSTATE_FREQUENCY_SET;\n}\nvoid radio_rfOn(void) {\n@@ -84,12 +100,22 @@ void radio_rfOff(void) {\nvoid radio_loadPacket(uint8_t* packet, uint16_t len) {\n+ radio_vars.state = RADIOSTATE_LOADING_PACKET;\n+\n+ NRF_RADIO->PACKETPTR = (uint32_t)packet;\n+\n+ radio_vars.state = RADIOSTATE_PACKET_LOADED;\n+\n}\nvoid radio_txEnable(void) {\n+ radio_vars.state = RADIOSTATE_ENABLING_TX;\n+ NRF_RADIO->TASKS_TXEN = 1U;\n+ radio_vars.state = RADIOSTATE_TX_ENABLED;\n}\n+\nvoid radio_txNow(void) {\n}\n@@ -97,8 +123,9 @@ void radio_txNow(void) {\n//===== RX\nvoid radio_rxEnable(void) {\n-\n-\n+ radio_vars.state = RADIOSTATE_ENABLING_RX;\n+ NRF_RADIO->TASKS_RXEN = 1U;\n+ radio_vars.state = RADIOSTATE_LISTENING;\n}\nvoid radio_rxNow(void) {\n@@ -112,6 +139,8 @@ void radio_getReceivedFrame(uint8_t* pBufRead,\nuint8_t* pLqi,\nbool* pCrc) {\n+\n+\n}\n//=========================== private =========================================\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
Early development stage for radio
|
491,605 |
07.06.2018 10:48:20
| -7,200 |
8250aeba2dfc3ddac44e1a4c71635ebfa17c9550
|
Tuned constants to yield sligthly better precision.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/nrf52840dk/sctimer.c",
"new_path": "bsp/boards/nrf52840dk/sctimer.c",
"diff": "// ========================== define ==========================================\n-#define MINIMUM_COMPAREVALE_ADVANCE 5\n-#define COMPAREVALE_ADVANCE_STEP 2\n+#define MINIMUM_COMPAREVALE_ADVANCE 2 // 5\n+#define COMPAREVALE_ADVANCE_STEP 1 // 2\n#define MAX_RTC_TASKS_DELAY 47 // maximum delay in us until an RTC config task is executed\n#define CC_TIMER 0 // CC channel used for the timer's compare value\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
Tuned constants to yield sligthly better precision.
|
491,604 |
07.06.2018 17:41:56
| -7,200 |
0d5ca4ceb6cbc688468903786859426942b44ff2
|
Not working transmit
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/nrf52840dk/SConscript",
"new_path": "bsp/boards/nrf52840dk/SConscript",
"diff": "@@ -22,6 +22,8 @@ source = \\\nGlob('sdk/modules/nrfx/drivers/src/nrfx_uart.c') + \\\nGlob('sdk/modules/nrfx/mdk/gcc_startup_nrf52840.S') + \\\nGlob('sdk/modules/nrfx/mdk/system_nrf52840.c') + \\\n+ Glob('sdk/components/drivers_nrf/radio_config/radio_config.c') + \\\n+ Glob('sdk/components/proprietary_rf/esb/nrf_esb.c') + \\\nGlob('*.c')\nlocalEnv.Append(\n@@ -51,6 +53,8 @@ localEnv.Append(\nos.path.join('#','bsp','boards','nrf52840dk','sdk','modules','nrfx','mdk'),\nos.path.join('#','bsp','boards','nrf52840dk','sdk','modules','nrfx','soc'),\nos.path.join('#','bsp','boards','nrf52840dk','sdk','modules','nrfx','templates'),\n+ os.path.join('#','bsp','boards','nrf52840dk','sdk','components','drivers_nrf','radio_config'),\n+ os.path.join('#','bsp','boards','nrf52840dk','sdk','components','proprietary_rf','esb'),\n# os.path.join('#','bsp','boards','nrf52840dk','sdk','modules','nrfx','templates','nRF52840'),\n],\n)\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/nrf52840dk/app_config.h",
"new_path": "bsp/boards/nrf52840dk/app_config.h",
"diff": "// power management\n#define NRF_PWR_MGMT_ENABLED 1\n+// radio\n+//#define NRF52\n+\n#endif // BSP_NRF52480_SDK_CONFIG_H\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/nrf52840dk/board.c",
"new_path": "bsp/boards/nrf52840dk/board.c",
"diff": "#include \"uart.h\"\n#include \"radio.h\"\n#include \"spi.h\"\n+#include \"radio.h\"\n//=========================== variables =======================================\n@@ -89,6 +90,8 @@ void board_init(void)\nspi_init();\nuart_writeByte('S'); nrf_delay_ms(10); ///< DEBUG, REMOVE ME!\n+ radio_init();\n+\nuart_writeByte('~'); ///< DEBUG, REMOVE ME!\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/nrf52840dk/radio.c",
"new_path": "bsp/boards/nrf52840dk/radio.c",
"diff": "#include \"sdk/components/boards/pca10056.h\"\n#include \"sdk/components/boards/boards.h\"\n+#include \"sdk/components/proprietary_rf/esb/nrf_esb.h\"\n#include \"sdk/components/drivers_nrf/radio_config/radio_config.h\"\n+#include \"sdk/components/proprietary_rf/esb/nrf_esb_error_codes.h\"\n#include \"sdk/modules/nrfx/mdk/nrf52840.h\"\n#include \"app_config.h\"\n//=========================== variables =======================================\n-bool radio_on;\n-\ntypedef struct {\nradio_capture_cbt startFrame_cb;\nradio_capture_cbt endFrame_cb;\n@@ -45,6 +45,9 @@ typedef struct {\nradio_vars_t radio_vars;\n+nrf_esb_payload_t tx_payload;\n+nrf_esb_payload_t rx_payload;\n+\n//=========================== prototypes ======================================\n//=========================== public ==========================================\n@@ -53,12 +56,12 @@ radio_vars_t radio_vars;\nvoid radio_init(void) {\n+ nrf_esb_config_t esb_config = NRF_ESB_DEFAULT_CONFIG;\n+\n// clear variables\nmemset(&radio_vars,0,sizeof(radio_vars_t));\n-\nradio_configure();\n-\n- radio_on = true;\n+ nrf_esb_init(&esb_config);\n}\n@@ -74,7 +77,6 @@ void radio_setEndFrameCb(radio_capture_cbt cb) {\nvoid radio_reset(void) {\n-\n}\n//===== RF admin\n@@ -102,29 +104,51 @@ void radio_loadPacket(uint8_t* packet, uint16_t len) {\nradio_vars.state = RADIOSTATE_LOADING_PACKET;\n- NRF_RADIO->PACKETPTR = (uint32_t)packet;\n+ if (len > 252)\n+ {\n+ leds_sync_toggle();\n+ }\n+ else\n+ {\n+\n+ nrf_esb_stop_rx();\n+ nrf_esb_disable();\n- radio_vars.state = RADIOSTATE_PACKET_LOADED;\n+ tx_payload.noack = true;\n+ tx_payload.pipe = 0;\n+ tx_payload.length = len;\n+ memcpy(tx_payload.data, packet, len);\n+ if(nrf_esb_write_payload(&tx_payload) == NRF_SUCCESS){\n+ leds_radio_toggle();\n+ radio_vars.state = RADIOSTATE_PACKET_LOADED;\n+ }\n+ }\n}\nvoid radio_txEnable(void) {\nradio_vars.state = RADIOSTATE_ENABLING_TX;\n- NRF_RADIO->TASKS_TXEN = 1U;\n+\n+ NRF_RADIO->TASKS_TXEN = 1;\n+\nradio_vars.state = RADIOSTATE_TX_ENABLED;\n}\nvoid radio_txNow(void) {\n+ radio_vars.state = RADIOSTATE_TRANSMITTING;\n+\n+ if (nrf_esb_start_tx() != NRF_SUCCESS)\n+ leds_debug_toggle();\n}\n//===== RX\nvoid radio_rxEnable(void) {\nradio_vars.state = RADIOSTATE_ENABLING_RX;\n- NRF_RADIO->TASKS_RXEN = 1U;\n+\nradio_vars.state = RADIOSTATE_LISTENING;\n}\n@@ -139,7 +163,10 @@ void radio_getReceivedFrame(uint8_t* pBufRead,\nuint8_t* pLqi,\nbool* pCrc) {\n+ radio_vars.state = RADIOSTATE_RECEIVING;\n+\n+ radio_vars.state = RADIOSTATE_TXRX_DONE;\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/nrf52840dk/sdk/components/proprietary_rf/esb/nrf_esb.h",
"new_path": "bsp/boards/nrf52840dk/sdk/components/proprietary_rf/esb/nrf_esb.h",
"diff": "@@ -83,7 +83,7 @@ extern \"C\" {\n// Hardcoded parameters - change if necessary\n#ifndef NRF_ESB_MAX_PAYLOAD_LENGTH\n-#define NRF_ESB_MAX_PAYLOAD_LENGTH 32 //!< The maximum size of the payload. Valid values are 1 to 252.\n+#define NRF_ESB_MAX_PAYLOAD_LENGTH 252 //!< The maximum size of the payload. Valid values are 1 to 252.\n#endif\n#define NRF_ESB_TX_FIFO_SIZE 8 //!< The size of the transmission first-in, first-out buffer.\n@@ -216,7 +216,7 @@ typedef enum {\ntypedef enum {\nNRF_ESB_BITRATE_2MBPS = RADIO_MODE_MODE_Nrf_2Mbit, /**< 2 Mb radio mode. */\nNRF_ESB_BITRATE_1MBPS = RADIO_MODE_MODE_Nrf_1Mbit, /**< 1 Mb radio mode. */\n- NRF_ESB_BITRATE_250KBPS = RADIO_MODE_MODE_Nrf_250Kbit, /**< 250 Kb radio mode. */\n+ //NRF_ESB_BITRATE_250KBPS = RADIO_MODE_MODE_Nrf_250Kbit, /**< 250 Kb radio mode. */\nNRF_ESB_BITRATE_1MBPS_BLE = RADIO_MODE_MODE_Ble_1Mbit, /**< 1 Mb radio mode using @e Bluetooth low energy radio parameters. */\n#if defined(NRF52)\nNRF_ESB_BITRATE_2MBPS_BLE = 4 /**< 2 Mb radio mode using @e Bluetooth low energy radio parameters. */\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
Not working transmit
|
491,595 |
12.06.2018 15:34:34
| -7,200 |
03080839d548f299835c7e339eb047dc3fa8c73c
|
Add license.md file
|
[
{
"change_type": "ADD",
"old_path": null,
"new_path": "LICENSE.md",
"diff": "+Copyright (c) 2010-2014, Regents of the University of California.\n+All rights reserved.\n+\n+Redistribution and use in source and binary forms, with or without\n+modification, are permitted provided that the following conditions are met:\n+\n+ - Redistributions of source code must retain the above copyright notice,\n+ this list of conditions and the following disclaimer.\n+\n+ - Redistributions in binary form must reproduce the above copyright notice,\n+ this list of conditions and the following disclaimer in the documentation\n+ and/or other materials provided with the distribution.\n+\n+ - Neither the name of the Regents of the University of California nor the\n+ names of its contributors may be used to endorse or promote products\n+ derived from this software without specific prior written permission.\n+\n+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\n+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n+POSSIBILITY OF SUCH DAMAGE.\n+\n\\ No newline at end of file\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
Add license.md file
|
491,604 |
21.06.2018 12:56:50
| -7,200 |
46b5f4fefc9a6c832231f8be8cb72697511e2ac9
|
Initial implementation, functions not working yet
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/nrf52840dk/SConscript",
"new_path": "bsp/boards/nrf52840dk/SConscript",
"diff": "@@ -24,6 +24,7 @@ source = \\\nGlob('sdk/modules/nrfx/mdk/system_nrf52840.c') + \\\nGlob('sdk/components/drivers_nrf/radio_config/radio_config.c') + \\\nGlob('sdk/components/proprietary_rf/esb/nrf_esb.c') + \\\n+ Glob('sdk/components/libraries/timer/app_timer.c') + \\\nGlob('*.c')\nlocalEnv.Append(\n@@ -54,7 +55,8 @@ localEnv.Append(\nos.path.join('#','bsp','boards','nrf52840dk','sdk','modules','nrfx','soc'),\nos.path.join('#','bsp','boards','nrf52840dk','sdk','modules','nrfx','templates'),\nos.path.join('#','bsp','boards','nrf52840dk','sdk','components','drivers_nrf','radio_config'),\n- os.path.join('#','bsp','boards','nrf52840dk','sdk','components','proprietary_rf','esb'),\n+# os.path.join('#','bsp','boards','nrf52840dk','sdk','components','proprietary_rf','esb'),\n+ os.path.join('#','bsp','boards','nrf52840dk','sdk','components','libraries','timer'),\n# os.path.join('#','bsp','boards','nrf52840dk','sdk','modules','nrfx','templates','nRF52840'),\n],\n)\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/nrf52840dk/app_config.h",
"new_path": "bsp/boards/nrf52840dk/app_config.h",
"diff": "// #define TIMER0_USE_EASY_DMA 0\n// enable the app_timer library (based on RTC1 [Real Time Counter]) to be used as TIMER\n-// #define APP_TIMER_ENABLED 1\n+#define APP_TIMER_ENABLED 1\n#define RTC_ENABLED 1 // solely for legacy driver calls (if any)\n#define RTC0_ENABLED 1 // solely for legacy driver calls (if any)\n#define NRFX_RTC_ENABLED 1\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/nrf52840dk/radio.c",
"new_path": "bsp/boards/nrf52840dk/radio.c",
"diff": "#include \"sdk/components/boards/pca10056.h\"\n#include \"sdk/components/boards/boards.h\"\n-#include \"sdk/components/proprietary_rf/esb/nrf_esb.h\"\n#include \"sdk/components/drivers_nrf/radio_config/radio_config.h\"\n-#include \"sdk/components/proprietary_rf/esb/nrf_esb_error_codes.h\"\n#include \"sdk/modules/nrfx/mdk/nrf52840.h\"\n+#include \"sdk/components/libraries/timer/app_timer.h\"\n#include \"app_config.h\"\n#include \"leds.h\"\n@@ -43,26 +42,55 @@ typedef struct {\nradio_state_t state;\n} radio_vars_t;\n-radio_vars_t radio_vars;\n+typedef struct {\n+ uint16_t length;\n+ uint8_t* packet;\n+} nrf_tx_payload;\n-nrf_esb_payload_t tx_payload;\n-nrf_esb_payload_t rx_payload;\n+typedef struct {\n+ uint8_t* pBufRead;\n+ uint8_t* pLenRead;\n+ uint8_t maxBufLen;\n+ int8_t* pRssi;\n+ uint8_t* pLqi;\n+ bool* pCrc;\n+} nrf_rx_payload;\n+\n+radio_vars_t radio_vars;\n+nrf_tx_payload tx_payload;\n+nrf_rx_payload rx_payload;\n//=========================== prototypes ======================================\n+\n//=========================== public ==========================================\n-//===== admin\nvoid radio_init(void) {\n- nrf_esb_config_t esb_config = NRF_ESB_DEFAULT_CONFIG;\n+ /* Start 16 MHz crystal oscillator */\n+ //NRF_CLOCK->EVENTS_HFCLKSTARTED = 0;\n+ //NRF_CLOCK->TASKS_HFCLKSTART = 1;\n- // clear variables\n- memset(&radio_vars,0,sizeof(radio_vars_t));\n- radio_configure();\n- nrf_esb_init(&esb_config);\n+ /* Wait for the external oscillator to start up */\n+ //while (NRF_CLOCK->EVENTS_HFCLKSTARTED == 0)\n+ //{\n+ // Do nothing.\n+ //}\n+ /* Start low frequency crystal oscillator for app_timer(used by bsp)*/\n+ //NRF_CLOCK->LFCLKSRC = (CLOCK_LFCLKSRC_SRC_Xtal << CLOCK_LFCLKSRC_SRC_Pos);\n+ //NRF_CLOCK->EVENTS_LFCLKSTARTED = 0;\n+ //NRF_CLOCK->TASKS_LFCLKSTART = 1;\n+\n+ //while (NRF_CLOCK->EVENTS_LFCLKSTARTED == 0)\n+ //{\n+ // Do nothing.\n+ //}\n+\n+ //sctimer_init();\n+\n+ radio_configure();\n}\nvoid radio_setStartFrameCb(radio_capture_cbt cb) {\n@@ -104,25 +132,16 @@ void radio_loadPacket(uint8_t* packet, uint16_t len) {\nradio_vars.state = RADIOSTATE_LOADING_PACKET;\n- if (len > 252)\n- {\n- leds_sync_toggle();\n- }\n- else\n+ if (len < 128)\n{\n-\n- nrf_esb_stop_rx();\n- nrf_esb_disable();\n-\n- tx_payload.noack = true;\n- tx_payload.pipe = 0;\ntx_payload.length = len;\n- memcpy(tx_payload.data, packet, len);\n+ tx_payload.packet = packet;\n+\n+ NRF_RADIO->PACKETPTR = (uint32_t)&tx_payload;\n- if(nrf_esb_write_payload(&tx_payload) == NRF_SUCCESS){\n- leds_radio_toggle();\nradio_vars.state = RADIOSTATE_PACKET_LOADED;\n- }\n+ //} else {\n+ //leds_error_toggle();\n}\n}\n@@ -130,6 +149,7 @@ void radio_txEnable(void) {\nradio_vars.state = RADIOSTATE_ENABLING_TX;\n+ NRF_RADIO->EVENTS_READY = 0U;\nNRF_RADIO->TASKS_TXEN = 1;\nradio_vars.state = RADIOSTATE_TX_ENABLED;\n@@ -140,8 +160,33 @@ void radio_txNow(void) {\nradio_vars.state = RADIOSTATE_TRANSMITTING;\n- if (nrf_esb_start_tx() != NRF_SUCCESS)\n- leds_debug_toggle();\n+ while (NRF_RADIO->EVENTS_READY == 0U)\n+ {\n+ // wait\n+ }\n+ NRF_RADIO->EVENTS_END = 0U;\n+ NRF_RADIO->TASKS_START = 1U;\n+\n+\n+ while (NRF_RADIO->EVENTS_END == 0U)\n+ {\n+ // wait\n+ }\n+\n+ //leds_sync_on();\n+\n+ NRF_RADIO->EVENTS_DISABLED = 0U;\n+ // Disable radio\n+ NRF_RADIO->TASKS_DISABLE = 1U;\n+\n+ while (NRF_RADIO->EVENTS_DISABLED == 0U)\n+ {\n+ // wait\n+ }\n+\n+ //leds_radio_toggle();\n+\n+ radio_vars.state = RADIOSTATE_TXRX_DONE;\n}\n//===== RX\n@@ -149,11 +194,47 @@ void radio_txNow(void) {\nvoid radio_rxEnable(void) {\nradio_vars.state = RADIOSTATE_ENABLING_RX;\n+ NRF_RADIO->EVENTS_READY = 0U;\n+ // Enable radio and wait for ready\n+ NRF_RADIO->TASKS_RXEN = 1;\n+\nradio_vars.state = RADIOSTATE_LISTENING;\n}\nvoid radio_rxNow(void) {\n+ radio_vars.state = RADIOSTATE_RECEIVING;\n+\n+ while (NRF_RADIO->EVENTS_READY == 0U)\n+ {\n+ // wait\n+ }\n+ NRF_RADIO->EVENTS_END = 0U;\n+ // Start listening and wait for address received event\n+ NRF_RADIO->TASKS_START = 1U;\n+\n+ // Wait for end of packet or buttons state changed\n+ while (NRF_RADIO->EVENTS_END == 0U)\n+ {\n+ // wait\n+ }\n+\n+ if (NRF_RADIO->CRCSTATUS == 1U)\n+ {\n+ //result = packet;\n+ }\n+ NRF_RADIO->EVENTS_DISABLED = 0U;\n+ // Disable radio\n+ NRF_RADIO->TASKS_DISABLE = 1U;\n+\n+ while (NRF_RADIO->EVENTS_DISABLED == 0U)\n+ {\n+ // wait\n+ }\n+\n+\n+ radio_vars.state = RADIOSTATE_TXRX_DONE;\n+\n}\nvoid radio_getReceivedFrame(uint8_t* pBufRead,\n@@ -163,10 +244,7 @@ void radio_getReceivedFrame(uint8_t* pBufRead,\nuint8_t* pLqi,\nbool* pCrc) {\n- radio_vars.state = RADIOSTATE_RECEIVING;\n-\n- radio_vars.state = RADIOSTATE_TXRX_DONE;\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/nrf52840dk/sdk/components/proprietary_rf/esb/nrf_esb.h",
"new_path": "bsp/boards/nrf52840dk/sdk/components/proprietary_rf/esb/nrf_esb.h",
"diff": "@@ -216,7 +216,7 @@ typedef enum {\ntypedef enum {\nNRF_ESB_BITRATE_2MBPS = RADIO_MODE_MODE_Nrf_2Mbit, /**< 2 Mb radio mode. */\nNRF_ESB_BITRATE_1MBPS = RADIO_MODE_MODE_Nrf_1Mbit, /**< 1 Mb radio mode. */\n- //NRF_ESB_BITRATE_250KBPS = RADIO_MODE_MODE_Nrf_250Kbit, /**< 250 Kb radio mode. */\n+ NRF_ESB_BITRATE_250KBPS = RADIO_MODE_MODE_Nrf_250Kbit, /**< 250 Kb radio mode. */\nNRF_ESB_BITRATE_1MBPS_BLE = RADIO_MODE_MODE_Ble_1Mbit, /**< 1 Mb radio mode using @e Bluetooth low energy radio parameters. */\n#if defined(NRF52)\nNRF_ESB_BITRATE_2MBPS_BLE = 4 /**< 2 Mb radio mode using @e Bluetooth low energy radio parameters. */\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/nrf52840dk/sdk/modules/nrfx/mdk/nrf52840_bitfields.h",
"new_path": "bsp/boards/nrf52840dk/sdk/modules/nrfx/mdk/nrf52840_bitfields.h",
"diff": "@@ -10585,6 +10585,7 @@ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#define RADIO_MODE_MODE_Msk (0xFUL << RADIO_MODE_MODE_Pos) /*!< Bit mask of MODE field. */\n#define RADIO_MODE_MODE_Nrf_1Mbit (0UL) /*!< 1 Mbit/s Nordic proprietary radio mode */\n#define RADIO_MODE_MODE_Nrf_2Mbit (1UL) /*!< 2 Mbit/s Nordic proprietary radio mode */\n+#define RADIO_MODE_MODE_Nrf_250Kbit (2UL) /*!< Deprecated enumerator - 250 kbit/s Nordic proprietary radio mode */\n#define RADIO_MODE_MODE_Ble_1Mbit (3UL) /*!< 1 Mbit/s BLE */\n#define RADIO_MODE_MODE_Ble_2Mbit (4UL) /*!< 2 Mbit/s BLE */\n#define RADIO_MODE_MODE_Ble_LR125Kbit (5UL) /*!< Long range 125 kbit/s TX, 125 kbit/s and 500 kbit/s RX */\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
Initial implementation, functions not working yet
|
491,595 |
21.06.2018 18:40:22
| -7,200 |
3a8e412e1ce900a4a9bf435298f4203abd904093
|
add protection for scheduleIn function.
|
[
{
"change_type": "MODIFY",
"old_path": "drivers/common/opentimers.c",
"new_path": "drivers/common/opentimers.c",
"diff": "@@ -92,6 +92,8 @@ void opentimers_scheduleIn(opentimers_id_t id,\nreturn;\n}\n+ DISABLE_INTERRUPTS();\n+\nopentimers_vars.timersBuf[id].timerType = timer_type;\n// 2. updat the timer content\n@@ -159,6 +161,7 @@ void opentimers_scheduleIn(opentimers_id_t id,\nsctimer_setCompare(opentimers_vars.currentTimeout);\n}\nopentimers_vars.running = TRUE;\n+ ENABLE_INTERRUPTS();\n}\n/**\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-761. add protection for scheduleIn function.
|
491,595 |
21.06.2018 18:46:17
| -7,200 |
134e2029ed798dde325f6ec9465c8c20f3cd1bae
|
use 5 ticks as MINIMUM_COMPAREVALE_ADVANCE (refer to user guide cc2538 section 13.2)
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/openmote-cc2538/sctimer.c",
"new_path": "bsp/boards/openmote-cc2538/sctimer.c",
"diff": "// ========================== define ==========================================\n#define TIMERLOOP_THRESHOLD 0xffffff // 511 seconds @ 32768Hz clock\n-#define MINIMUM_COMPAREVALE_ADVANCE 10\n+// refer to SWRU319C cc2538 user's guide: section 13.2:\n+// -- When setting a new compare value, the value must be at least 5 more than the\n+// -- current sleep timer value. Otherwise, the timer compare event may be lost.\n+#define MINIMUM_COMPAREVALE_ADVANCE 5\n// ========================== variable ========================================\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-761. use 5 ticks as MINIMUM_COMPAREVALE_ADVANCE (refer to user guide cc2538 section 13.2)
|
491,595 |
21.06.2018 18:47:52
| -7,200 |
9cf2f1f0f2c5324e31d3edadbe9af551b878b176
|
increase 5 ticks of ACK prepare interval (observed from debugging pin) as opentimer callback taking longer time than before.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/openmote-cc2538/board_info.h",
"new_path": "bsp/boards/openmote-cc2538/board_info.h",
"diff": "#define PORT_maxTxDataPrepare 10 // 305us (measured 82us)\n#define PORT_maxRxAckPrepare 10 // 305us (measured 83us)\n#define PORT_maxRxDataPrepare 4 // 122us (measured 22us)\n- #define PORT_maxTxAckPrepare 10 // 122us (measured 94us)\n+ #define PORT_maxTxAckPrepare 15 // 122us (measured 94us)\n// radio speed related\n#ifdef L2_SECURITY_ACTIVE\n#define PORT_delayTx 14 // 366us (measured xxxus)\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-761. increase 5 ticks of ACK prepare interval (observed from debugging pin) as opentimer callback taking longer time than before.
|
491,604 |
23.06.2018 18:40:04
| -7,200 |
8810b6c049ddecabf5cc964ab6802cc95667ac42
|
Transmit is probably working now, need to check what is actually sent
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/nrf52840dk/radio.c",
"new_path": "bsp/boards/nrf52840dk/radio.c",
"diff": "//#define RSSI_OFFSET 73\n//#define CHECKSUM_LEN 2\n+/* For calculating frequency */\n+#define FREQUENCY_OFFSET 10\n+#define FREQUENCY_STEP 5\n+\n//=========================== variables =======================================\ntypedef struct {\n@@ -43,7 +47,7 @@ typedef struct {\n} radio_vars_t;\ntypedef struct {\n- uint16_t length;\n+ uint8_t length;\nuint8_t* packet;\n} nrf_tx_payload;\n@@ -59,6 +63,7 @@ typedef struct {\nradio_vars_t radio_vars;\nnrf_tx_payload tx_payload;\nnrf_rx_payload rx_payload;\n+PORT_TIMER_WIDTH capturedTime;\n//=========================== prototypes ======================================\n@@ -68,29 +73,9 @@ nrf_rx_payload rx_payload;\nvoid radio_init(void) {\n- /* Start 16 MHz crystal oscillator */\n- //NRF_CLOCK->EVENTS_HFCLKSTARTED = 0;\n- //NRF_CLOCK->TASKS_HFCLKSTART = 1;\n-\n- /* Wait for the external oscillator to start up */\n- //while (NRF_CLOCK->EVENTS_HFCLKSTARTED == 0)\n- //{\n- // Do nothing.\n- //}\n-\n- /* Start low frequency crystal oscillator for app_timer(used by bsp)*/\n- //NRF_CLOCK->LFCLKSRC = (CLOCK_LFCLKSRC_SRC_Xtal << CLOCK_LFCLKSRC_SRC_Pos);\n- //NRF_CLOCK->EVENTS_LFCLKSTARTED = 0;\n- //NRF_CLOCK->TASKS_LFCLKSTART = 1;\n-\n- //while (NRF_CLOCK->EVENTS_LFCLKSTARTED == 0)\n- //{\n- // Do nothing.\n- //}\n-\n- //sctimer_init();\n-\nradio_configure();\n+ NRF_RADIO->MODE = (RADIO_MODE_MODE_Ieee802154_250Kbit << RADIO_MODE_MODE_Pos);\n+\n}\nvoid radio_setStartFrameCb(radio_capture_cbt cb) {\n@@ -113,7 +98,7 @@ void radio_setFrequency(uint8_t frequency) {\nradio_vars.state = RADIOSTATE_SETTING_FREQUENCY;\n- NRF_RADIO->FREQUENCY = frequency;\n+ NRF_RADIO->FREQUENCY = (frequency - FREQUENCY_OFFSET) * FREQUENCY_STEP;\nradio_vars.state = RADIOSTATE_FREQUENCY_SET;\n}\n@@ -123,7 +108,8 @@ void radio_rfOn(void) {\n}\nvoid radio_rfOff(void) {\n-\n+ // Disable radio\n+ NRF_RADIO->TASKS_DISABLE = 1U;\n}\n//===== TX\n@@ -134,14 +120,12 @@ void radio_loadPacket(uint8_t* packet, uint16_t len) {\nif (len < 128)\n{\n- tx_payload.length = len;\n+ tx_payload.length = (uint8_t)len;\ntx_payload.packet = packet;\nNRF_RADIO->PACKETPTR = (uint32_t)&tx_payload;\nradio_vars.state = RADIOSTATE_PACKET_LOADED;\n- //} else {\n- //leds_error_toggle();\n}\n}\n@@ -167,13 +151,21 @@ void radio_txNow(void) {\nNRF_RADIO->EVENTS_END = 0U;\nNRF_RADIO->TASKS_START = 1U;\n+ while (NRF_RADIO->STATE != RADIO_STATE_STATE_Tx)\n+ {\n+ // wait untill radio enters TX state so we can call callback\n+ }\n+ capturedTime = sctimer_readCounter();\n+ radio_vars.startFrame_cb(capturedTime);\nwhile (NRF_RADIO->EVENTS_END == 0U)\n{\n// wait\n}\n- //leds_sync_on();\n+ capturedTime = sctimer_readCounter();\n+ radio_vars.endFrame_cb(capturedTime);\n+\nNRF_RADIO->EVENTS_DISABLED = 0U;\n// Disable radio\n@@ -183,7 +175,6 @@ void radio_txNow(void) {\n{\n// wait\n}\n-\n//leds_radio_toggle();\nradio_vars.state = RADIOSTATE_TXRX_DONE;\n@@ -203,8 +194,20 @@ void radio_rxEnable(void) {\nvoid radio_rxNow(void) {\n+\n+\n+}\n+\n+void radio_getReceivedFrame(uint8_t* pBufRead,\n+ uint8_t* pLenRead,\n+ uint8_t maxBufLen,\n+ int8_t* pRssi,\n+ uint8_t* pLqi,\n+ bool* pCrc) {\n+\nradio_vars.state = RADIOSTATE_RECEIVING;\n+ leds_radio_toggle();\nwhile (NRF_RADIO->EVENTS_READY == 0U)\n{\n// wait\n@@ -219,6 +222,7 @@ void radio_rxNow(void) {\n// wait\n}\n+\nif (NRF_RADIO->CRCSTATUS == 1U)\n{\n//result = packet;\n@@ -235,17 +239,6 @@ void radio_rxNow(void) {\nradio_vars.state = RADIOSTATE_TXRX_DONE;\n-}\n-\n-void radio_getReceivedFrame(uint8_t* pBufRead,\n- uint8_t* pLenRead,\n- uint8_t maxBufLen,\n- int8_t* pRssi,\n- uint8_t* pLqi,\n- bool* pCrc) {\n-\n-\n-\n}\n//=========================== private =========================================\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/common/01bsp_radio/01bsp_radio.c",
"new_path": "projects/common/01bsp_radio/01bsp_radio.c",
"diff": "@@ -110,6 +110,7 @@ int mote_main(void) {\nwhile (1) {\n+\n// sleep while waiting for at least one of the flags to be set\nwhile (app_vars.flags==0x00) {\nboard_sleep();\n@@ -129,13 +130,13 @@ int mote_main(void) {\n// started receiving a packet\n// led\n- leds_error_on();\n+ leds_error_toggle();\nbreak;\ncase APP_STATE_TX:\n// started sending a packet\n+ leds_sync_toggle();\n// led\n- leds_sync_on();\nbreak;\n}\n@@ -167,7 +168,7 @@ int mote_main(void) {\n);\n// led\n- leds_error_off();\n+ //leds_error_off();\nbreak;\ncase APP_STATE_TX:\n// done sending a packet\n@@ -177,7 +178,7 @@ int mote_main(void) {\napp_vars.state = APP_STATE_RX;\n// led\n- leds_sync_off();\n+ //leds_sync_off();\nbreak;\n}\n// clear flag\n@@ -189,7 +190,6 @@ int mote_main(void) {\nif (app_vars.flags & APP_FLAG_TIMER) {\n// timer fired\n-\nif (app_vars.state==APP_STATE_RX) {\n// stop listening\nradio_rfOff();\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
Transmit is probably working now, need to check what is actually sent
|
491,595 |
26.06.2018 00:16:01
| -7,200 |
b9e099e81ba04d1e953c22af2b50b7a50d3e1df9
|
Disable MSF add/delete cells after first cell is added.
|
[
{
"change_type": "MODIFY",
"old_path": "SConscript",
"new_path": "SConscript",
"diff": "@@ -46,6 +46,8 @@ if env['noadaptivesync']==1:\nenv.Append(CPPDEFINES = 'NOADAPTIVESYNC')\nif env['l2_security']==1:\nenv.Append(CPPDEFINES = 'L2_SECURITY_ACTIVE')\n+if env['msf_adapting_to_traffic']==1:\n+ env.Append(CPPDEFINES = 'MSF_ADAPTING_TO_TRAFFIC')\nif env['printf']==1:\nenv.Append(CPPDEFINES = 'OPENSERIAL_PRINTF')\nif env['deadline_option']==1:\n"
},
{
"change_type": "MODIFY",
"old_path": "SConstruct",
"new_path": "SConstruct",
"diff": "@@ -79,6 +79,8 @@ project:\nnoadaptivesync Do not use adaptive synchronization.\nl2_security Use hop-by-hop encryption and authentication.\n0 (off), 1 (on)\n+ msf_adapting_to_traffic enable/disable MSF for adding/deleting cell to adapt to traffic\n+ 0 (disable), 1 (enable)\nprintf Sends the string messages to openvisualizer\n0 (off ), 1 (on, default)\nide qtcreator\n@@ -140,6 +142,7 @@ command_line_options = {\n'debug': ['0','1'],\n'noadaptivesync': ['0','1'],\n'l2_security': ['0','1'],\n+ 'msf_adapting_to_traffic': ['0','1'],\n'printf': ['1','0'], # 1=on (default), 0=off\n'deadline_option': ['0','1'],\n'ide': ['none','qtcreator'],\n@@ -288,6 +291,13 @@ command_line_vars.AddVariables(\nvalidate_option, # validator\nint, # converter\n),\n+ (\n+ 'msf_adapting_to_traffic', # key\n+ '', # help\n+ command_line_options['msf_adapting_to_traffic'][1],# default\n+ validate_option, # validator\n+ int, # converter\n+ ),\n(\n'printf', # key\n'', # help\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/msf.c",
"new_path": "openstack/02b-MAChigh/msf.c",
"diff": "@@ -59,7 +59,7 @@ void msf_init(void) {\n// called by schedule\nvoid msf_updateCellsPassed(open_addr_t* neighbor){\n-\n+#ifdef MSF_ADAPTING_TO_TRAFFIC\nif (icmpv6rpl_isPreferredParent(neighbor)==FALSE){\nreturn;\n}\n@@ -75,6 +75,7 @@ void msf_updateCellsPassed(open_addr_t* neighbor){\nmsf_vars.numCellsPassed = 0;\nmsf_vars.numCellsUsed = 0;\n}\n+#endif\n}\nvoid msf_updateCellsUsed(open_addr_t* neighbor){\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-741. Disable MSF add/delete cells after first cell is added.
|
491,595 |
26.06.2018 12:28:08
| -7,200 |
3634bfbb2d26d87593d3257ae15b2d4befb805a4
|
Fix the maxRankIncrease and minHopRankIncrease bytes order.
|
[
{
"change_type": "MODIFY",
"old_path": "openstack/03b-IPv6/icmpv6rpl.c",
"new_path": "openstack/03b-IPv6/icmpv6rpl.c",
"diff": "@@ -530,7 +530,14 @@ void icmpv6rpl_indicateRxDIO(OpenQueueEntry_t* msg) {\ncase RPL_OPTION_CONFIG:\n// configuration option\nicmpv6rpl_vars.incomingConf = (icmpv6rpl_config_ht*)(current);\n+\n+ icmpv6rpl_vars.incomingConf->maxRankIncrease = (icmpv6rpl_vars.incomingConf->maxRankIncrease << 8) | (icmpv6rpl_vars.incomingConf->maxRankIncrease >>8); // 2048\n+ icmpv6rpl_vars.incomingConf->minHopRankIncrease = (icmpv6rpl_vars.incomingConf->minHopRankIncrease << 8) | (icmpv6rpl_vars.incomingConf->minHopRankIncrease >>8); //256\n+ icmpv6rpl_vars.incomingConf->OCP = (icmpv6rpl_vars.incomingConf->OCP << 8) | (icmpv6rpl_vars.incomingConf->OCP >>8); // 0 OF0\n+ icmpv6rpl_vars.incomingConf->lifetimeUnit = (icmpv6rpl_vars.incomingConf->lifetimeUnit << 8) | (icmpv6rpl_vars.incomingConf->lifetimeUnit >>8); // 0xffff\n+\nmemcpy(&icmpv6rpl_vars.conf,icmpv6rpl_vars.incomingConf, sizeof(icmpv6rpl_config_ht));\n+\n// do whatever needs to be done with the configuration option of RPL\noptionsLen = optionsLen - current[1] - 2;\ncurrent = current + current[1] + 2;\n@@ -687,11 +694,16 @@ void sendDIO(void) {\n//copy the PIO in the packet\nmemcpy(\n- ((icmpv6rpl_pio_t*)(msg->payload)),\n+ ((icmpv6rpl_config_ht*)(msg->payload)),\n&(icmpv6rpl_vars.conf),\nsizeof(icmpv6rpl_config_ht)\n);\n+ ((icmpv6rpl_config_ht*)(msg->payload))->maxRankIncrease = (icmpv6rpl_vars.conf.maxRankIncrease << 8) | (icmpv6rpl_vars.conf.maxRankIncrease >>8); // 2048\n+ ((icmpv6rpl_config_ht*)(msg->payload))->minHopRankIncrease = (icmpv6rpl_vars.conf.minHopRankIncrease << 8) | (icmpv6rpl_vars.conf.minHopRankIncrease >>8); //256\n+ ((icmpv6rpl_config_ht*)(msg->payload))->OCP = (icmpv6rpl_vars.conf.OCP << 8) | (icmpv6rpl_vars.conf.OCP >>8); // 0 OF0\n+ ((icmpv6rpl_config_ht*)(msg->payload))->lifetimeUnit = (icmpv6rpl_vars.conf.lifetimeUnit << 8) | (icmpv6rpl_vars.conf.lifetimeUnit >>8); // 0xffff\n+\n//===== PIO payload\npacketfunctions_reserveHeaderSize(msg,sizeof(icmpv6rpl_pio_t));\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
Fix the maxRankIncrease and minHopRankIncrease bytes order.
|
491,609 |
26.06.2018 16:27:28
| -7,200 |
497ee7164b59f64c61a7a00b410d29512e4ad647
|
Make sure join packets are link-local and compressed correctly
Remove trailing whitespaces.
|
[
{
"change_type": "MODIFY",
"old_path": "openstack/03b-IPv6/forwarding.c",
"new_path": "openstack/03b-IPv6/forwarding.c",
"diff": "@@ -71,7 +71,6 @@ owerror_t forwarding_send(OpenQueueEntry_t* msg) {\nipv6_header_iht ipv6_outer_header;\nipv6_header_iht ipv6_inner_header;\nrpl_option_ht rpl_option;\n- open_addr_t link_local_prefix;\n#ifdef DEADLINE_OPTION_ENABLED\ndeadline_option_ht deadline_option;\n#endif\n@@ -103,19 +102,29 @@ owerror_t forwarding_send(OpenQueueEntry_t* msg) {\n// set source address (me)\nmsg->l3_sourceAdd.type=ADDR_128B;\n+ packetfunctions_ip128bToMac64b(&(msg->l3_destinationAdd),&temp_dest_prefix,&temp_dest_mac64b);\n+ //xv poipoi -- get the src prefix as well\n+ packetfunctions_ip128bToMac64b(&(msg->l3_sourceAdd),&temp_src_prefix,&temp_src_mac64b);\n+ //XV -poipoi we want to check if the source address prefix is the same as destination prefix\n// if we are sending to a link-local address set the source prefix to link-local\nif (packetfunctions_isLinkLocal(&msg->l3_destinationAdd) ||\npacketfunctions_isAllRoutersMulticast(&msg->l3_destinationAdd) ||\npacketfunctions_isAllHostsMulticast(&msg->l3_destinationAdd)) {\n- memset(&link_local_prefix, 0x00, sizeof(open_addr_t));\n- link_local_prefix.type = ADDR_PREFIX;\n- link_local_prefix.prefix[0] = 0xfe;\n- link_local_prefix.prefix[1] = 0x80;\n- myprefix = &link_local_prefix;\n+ memset(&temp_src_prefix, 0x00, sizeof(open_addr_t));\n+ temp_src_prefix.type = ADDR_PREFIX;\n+ temp_src_prefix.prefix[0] = 0xfe;\n+ temp_src_prefix.prefix[1] = 0x80;\n+ myprefix = &temp_src_prefix;\n+ sac = IPHC_SAC_STATELESS;\n+ dac = IPHC_DAC_STATELESS;\n+ } else if (packetfunctions_sameAddress(&temp_dest_prefix,&temp_src_prefix)==FALSE && packetfunctions_isBroadcastMulticast(&(msg->l3_destinationAdd))==FALSE) {\n+ myprefix = idmanager_getMyID(ADDR_PREFIX);\nsac = IPHC_SAC_STATELESS;\ndac = IPHC_DAC_STATELESS;\n} else {\nmyprefix = idmanager_getMyID(ADDR_PREFIX);\n+ sac = IPHC_SAC_STATEFUL;\n+ dac = IPHC_DAC_STATEFUL;\n}\nmemcpy(&(msg->l3_sourceAdd.addr_128b[0]),myprefix->prefix,8);\nmemcpy(&(msg->l3_sourceAdd.addr_128b[8]),myadd64->addr_64b,8);\n@@ -143,14 +152,8 @@ owerror_t forwarding_send(OpenQueueEntry_t* msg) {\n);\n#endif\n- packetfunctions_ip128bToMac64b(&(msg->l3_destinationAdd),&temp_dest_prefix,&temp_dest_mac64b);\n- //xv poipoi -- get the src prefix as well\n- packetfunctions_ip128bToMac64b(&(msg->l3_sourceAdd),&temp_src_prefix,&temp_src_mac64b);\n- //XV -poipoi we want to check if the source address prefix is the same as destination prefix\n- if (packetfunctions_sameAddress(&temp_dest_prefix,&temp_src_prefix)) {\n+ if (packetfunctions_sameAddress(&temp_dest_prefix, myprefix)) {\n// same prefix use 64B address\n- sac = IPHC_SAC_STATEFUL;\n- dac = IPHC_DAC_STATEFUL;\nsam = IPHC_SAM_64B;\ndam = IPHC_DAM_64B;\np_dest = &temp_dest_mac64b;\n@@ -159,8 +162,6 @@ owerror_t forwarding_send(OpenQueueEntry_t* msg) {\n//not the same prefix. so the packet travels to another network\n//check if this is a source routing pkt. in case it is then the DAM is elided as it is in the SrcRouting header.\nif (packetfunctions_isBroadcastMulticast(&(msg->l3_destinationAdd))==FALSE){\n- sac = IPHC_SAC_STATELESS;\n- dac = IPHC_DAC_STATELESS;\nsam = IPHC_SAM_128B;\ndam = IPHC_DAM_128B;\np_dest = &(msg->l3_destinationAdd);\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-756: Make sure join packets are link-local and compressed correctly
Remove trailing whitespaces.
|
491,609 |
29.06.2018 15:47:34
| -7,200 |
c4dcf0faf61c51bc04befe2670f09305ce3edf6c
|
Bug fix when sending to the same network prefix
|
[
{
"change_type": "MODIFY",
"old_path": "openstack/03b-IPv6/forwarding.c",
"new_path": "openstack/03b-IPv6/forwarding.c",
"diff": "@@ -103,9 +103,9 @@ owerror_t forwarding_send(OpenQueueEntry_t* msg) {\nmsg->l3_sourceAdd.type=ADDR_128B;\npacketfunctions_ip128bToMac64b(&(msg->l3_destinationAdd),&temp_dest_prefix,&temp_dest_mac64b);\n- //xv poipoi -- get the src prefix as well\n- packetfunctions_ip128bToMac64b(&(msg->l3_sourceAdd),&temp_src_prefix,&temp_src_mac64b);\n- //XV -poipoi we want to check if the source address prefix is the same as destination prefix\n+ // at this point, we still haven't written in the packet the source prefix\n+ // that we will use - it depends whether the destination address is link-local or not\n+\n// if we are sending to a link-local address set the source prefix to link-local\nif (packetfunctions_isLinkLocal(&msg->l3_destinationAdd) ||\npacketfunctions_isAllRoutersMulticast(&msg->l3_destinationAdd) ||\n@@ -117,7 +117,7 @@ owerror_t forwarding_send(OpenQueueEntry_t* msg) {\nmyprefix = &temp_src_prefix;\nsac = IPHC_SAC_STATELESS;\ndac = IPHC_DAC_STATELESS;\n- } else if (packetfunctions_sameAddress(&temp_dest_prefix,&temp_src_prefix)==FALSE && packetfunctions_isBroadcastMulticast(&(msg->l3_destinationAdd))==FALSE) {\n+ } else if (packetfunctions_sameAddress(&temp_dest_prefix,idmanager_getMyID(ADDR_PREFIX))==FALSE && packetfunctions_isBroadcastMulticast(&(msg->l3_destinationAdd))==FALSE) {\nmyprefix = idmanager_getMyID(ADDR_PREFIX);\nsac = IPHC_SAC_STATELESS;\ndac = IPHC_DAC_STATELESS;\n@@ -126,6 +126,7 @@ owerror_t forwarding_send(OpenQueueEntry_t* msg) {\nsac = IPHC_SAC_STATEFUL;\ndac = IPHC_DAC_STATEFUL;\n}\n+ // myprefix now contains the pointer to the correct prefix to use (link-local or global)\nmemcpy(&(msg->l3_sourceAdd.addr_128b[0]),myprefix->prefix,8);\nmemcpy(&(msg->l3_sourceAdd.addr_128b[8]),myadd64->addr_64b,8);\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-756. Bug fix when sending to the same network prefix
|
491,609 |
01.06.2018 12:01:23
| -7,200 |
9d1ab4d5a7b30b95ee58f0dcebe962f3fcda8169
|
cojp_cbor: First update of data structs to reflect minimal-security-06
|
[
{
"change_type": "MODIFY",
"old_path": "openapps/cjoin/cbor.h",
"new_path": "openapps/cjoin/cbor.h",
"diff": "//=========================== define ==========================================\n// max number of keys supported in COSE_KeySet\n-#define COSE_KEYSET_MAX_NUM_KEYS 2\n+#define KEYSET_MAX_NUM_KEYS 2\n// CBOR additional info mask\n#define CBOR_ADDINFO_MASK 0x1F\n-// max number of pairs in COSE symmetric key struct\n-#define COSE_SYMKEY_MAXNUMPAIRS 6\n-// 802.15.4 short address\n-#define SHORT_ADDRESS_LENGTH 2\n// symmetric key length\n-#define COSE_SYMKEY_LENGTH 16\n-// key id length\n-#define COSE_SYMKEY_KEYID_LENGTH 1\n+#define AES128_KEY_LENGTH 16\n+// IEEE 802.15.4 key id length\n+#define IEEE802154_KEYID_LENGTH 1\n+// IEEE 802.15.4 short address\n+#define IEEE802154_SHORT_ADDRESS_LENGTH 2\n+// CoJP Configuration object constants\n+#define COJP_CONFIGURATION_MAX_NUM_PARAMS 3 // TODO we don't support 6LBR joining for now\n+// CoJP Min num elements in a key\n+#define COJP_KEY_MIN_NUM_ELEMS 2\n//=========================== typedef =========================================\n// CBOR major types\n@@ -34,49 +36,65 @@ typedef enum {\nCBOR_MAJORTYPE_MAP = 5,\n} cbor_majortype_t;\n-// COSE key map labels\ntypedef enum {\n- COSE_KEY_LABEL_KTY = 1,\n- COSE_KEY_LABEL_KID = 2,\n- COSE_KEY_LABEL_ALG = 3,\n- COSE_KEY_LABEL_KEYOPS = 4,\n- COSE_KEY_LABEL_BASEIV = 5,\n- COSE_KEY_LABEL_K = 32, // -1\n-} cose_key_label_t;\n-\n-// COSE key type values\n+ COJP_PARAMETERS_LABELS_ROLE = 1, // Identifies the role parameter\n+ COJP_PARAMETERS_LABELS_LLKEYSET = 2, // Identifies the array carrying one or more link-layer cryptographic keys\n+ COJP_PARAMETERS_LABELS_LLSHORTADDRESS = 3, // Identifies the assigned link-layer short address\n+ COJP_PARAMETERS_LABELS_JRCADDRESS = 4, // Identifies the IPv6 address of the JRC\n+ COJP_PARAMETERS_LABELS_NETID = 5, // Identifies the network identifier (PAN ID)\n+ COJP_PARAMETERS_LABELS_NETPREFIX = 6, // Identifies the IPv6 prefix of the network\n+} cojp_parameters_labels_t;\n+\n+typedef enum {\n+ COJP_ROLE_VALUE_6N = 0, // 6TiSCH Node\n+ COJP_ROLE_VALUE_6LBR = 1, // 6LBR Node\n+} cojp_role_values_t;\n+\ntypedef enum {\n- COSE_KEY_VALUE_OKP = 1,\n- COSE_KEY_VALUE_EC2 = 2,\n- COSE_KEY_VALUE_SYMMETRIC = 4,\n-} cose_key_value_t;\n+ COJP_KEY_USAGE_6TiSCH_K1K2_ENC_MIC32 = 0,\n+ COJP_KEY_USAGE_6TiSCH_K1K2_ENC_MIC64 = 1,\n+ COJP_KEY_USAGE_6TiSCH_K1K2_ENC_MIC128 = 2,\n+ COJP_KEY_USAGE_6TiSCH_K1K2_MIC32 = 3,\n+ COJP_KEY_USAGE_6TiSCH_K1K2_MIC64 = 4,\n+ COJP_KEY_USAGE_6TiSCH_K1K2_MIC128 = 5,\n+ COJP_KEY_USAGE_6TiSCH_K1_MIC32 = 6,\n+ COJP_KEY_USAGE_6TiSCH_K1_MIC64 = 7,\n+ COJP_KEY_USAGE_6TiSCH_K1_MIC128 = 8,\n+ COJP_KEY_USAGE_6TiSCH_K2_MIC32 = 9,\n+ COJP_KEY_USAGE_6TiSCH_K2_MIC64 = 10,\n+ COJP_KEY_USAGE_6TiSCH_K2_MIC128 = 11,\n+ COJP_KEY_USAGE_6TiSCH_K2_ENC_MIC32 = 12,\n+ COJP_KEY_USAGE_6TiSCH_K2_ENC_MIC64 = 13,\n+ COJP_KEY_USAGE_6TiSCH_K2_ENC_MIC128 = 14,\n+} cojp_key_usage_values_t;\ntypedef struct {\n- uint8_t address[SHORT_ADDRESS_LENGTH];\n- asn_t lease_asn;\n-} short_address_t;\n+ uint8_t address[IEEE802154_SHORT_ADDRESS_LENGTH];\n+ uint32_t lease_time;\n+} cojp_link_layer_short_address_t;\ntypedef struct {\n- cose_key_value_t kty;\n- uint8_t kid[COSE_SYMKEY_KEYID_LENGTH];\n- uint8_t k[COSE_SYMKEY_LENGTH];\n-} COSE_symmetric_key_t;\n+ uint8_t key_index;\n+ cojp_key_usage_values_t key_usage;\n+ uint8_t key_value[AES128_KEY_LENGTH];\n+} cojp_link_layer_key_t;\ntypedef struct {\n- COSE_symmetric_key_t key[COSE_KEYSET_MAX_NUM_KEYS];\n-} COSE_keyset_t;\n+ cojp_link_layer_key_t key[KEYSET_MAX_NUM_KEYS];\n+} cojp_link_layer_keyset_t;\ntypedef struct {\n- COSE_keyset_t keyset;\n- short_address_t short_address;\n-} join_response_t;\n+ cojp_link_layer_keyset_t keyset;\n+ cojp_link_layer_short_address_t short_address;\n+ open_addr_t jrc_address;\n+} cojp_configuration_object_t;\n//=========================== variables =======================================\n//=========================== prototypes ======================================\n-owerror_t cbor_parse_join_response(join_response_t *, uint8_t *, uint8_t);\n+owerror_t cojp_cbor_decode_configuration_object(uint8_t *buf, uint8_t len, cojp_configuration_object_t *configuration);\n/**\n\\}\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
cojp_cbor: First update of data structs to reflect minimal-security-06
|
491,609 |
01.06.2018 16:21:43
| -7,200 |
aec666ec66394c88d0b3d283f48d46a502483f99
|
cojp_cbor: Implement CBOR decoder for objects defined in minimal-security-06
|
[
{
"change_type": "MODIFY",
"old_path": "openapps/cjoin/cbor.c",
"new_path": "openapps/cjoin/cbor.c",
"diff": "//=========================== variables =======================================\n//=========================== prototypes ======================================\n-owerror_t cbor_parse_keyset(COSE_keyset_t *, uint8_t *, uint8_t *);\n-owerror_t cbor_parse_short_address(short_address_t *, uint8_t *, uint8_t *);\n-owerror_t cbor_parse_key(COSE_symmetric_key_t *, uint8_t *, uint8_t *);\n+owerror_t cojp_cbor_decode_link_layer_keyset(uint8_t *, uint8_t *, cojp_link_layer_keyset_t *);\n+owerror_t cojp_cbor_decode_link_layer_short_address(uint8_t *, uint8_t *, cojp_link_layer_short_address_t *);\n+owerror_t cojp_cbor_decode_ipv6_address(uint8_t *, uint8_t *, open_addr_t *);\n+uint8_t cbor_decode_uint(uint8_t *buf, uint8_t *value);\n//=========================== public ==========================================\n/**\n-\\brief Parse the received join response.\n+\\brief Parse the CoJP Configuration object.\n-This function expects the join response structure from minimal-security-02 draft.\n+The function expects COSE symmetric key as per minimal-security-02 draft\n+and parses it into COSE_symmetric_key_t structure.\n-\\param[out] response The join_response_t structure containing parsed info.\n-\\param[in] buf The received join response.\n-\\param[in] len Length of the payload.\n+\\param[in] buf Input buffer.\n+\\param[out] len Processed length.\n+\\param[out] configuration The cojp_configuration_object_t structure containing parsed parameters.\n*/\n-owerror_t cbor_parse_join_response(join_response_t *response, uint8_t *buf, uint8_t len) {\n+owerror_t cojp_cbor_decode_configuration_object(uint8_t *buf, uint8_t len, cojp_configuration_object_t *configuration) {\ncbor_majortype_t major_type;\n- uint8_t additional_info;\n+ uint8_t num_elems;\nuint8_t ret;\n+ uint8_t i;\nuint8_t *tmp;\n- owerror_t error;\n+ uint8_t error;\n- memset(response, 0x00, sizeof(join_response_t));\n+ memset(configuration, 0x00, sizeof(cojp_configuration_object_t));\n+ ret = 0;\n+ error = 0;\n- error = E_SUCCESS;\ntmp = buf;\nmajor_type = (cbor_majortype_t) *buf >> 5;\n- additional_info = *buf & CBOR_ADDINFO_MASK;\n+ num_elems = *buf & CBOR_ADDINFO_MASK;\n- do {\n- if (major_type != CBOR_MAJORTYPE_ARRAY) {\n- error = E_FAIL;\n- break;\n+ if (major_type != CBOR_MAJORTYPE_MAP) {\n+ return E_FAIL;\n}\n- if (additional_info > 2 || additional_info == 0) {\n- error = E_FAIL; // unsupported join response structure\n- break;\n+ if (num_elems > COJP_CONFIGURATION_MAX_NUM_PARAMS) {\n+ return E_FAIL; // unsupported configuration object structure\n}\ntmp++;\n- if (cbor_parse_keyset(&(response->keyset), tmp, &ret) == E_FAIL) {\n- error = E_FAIL;\n+ for (i = 0; i < num_elems; i++) {\n+ switch((cojp_parameters_labels_t) *tmp) {\n+ case COJP_PARAMETERS_LABELS_LLKEYSET:\n+ tmp++;\n+ if (cojp_cbor_decode_link_layer_keyset(tmp, &ret, &(configuration->keyset)) == E_FAIL) {\n+ error++;\n+ }\n+ tmp += ret;\nbreak;\n+ case COJP_PARAMETERS_LABELS_LLSHORTADDRESS:\n+ if (cojp_cbor_decode_link_layer_short_address(tmp, &ret, &(configuration->short_address)) == E_FAIL) {\n+ error++;\n}\n-\ntmp += ret;\n-\n- if (additional_info == 2) { // short address present\n- if (cbor_parse_short_address(&(response->short_address), tmp, &ret) == E_FAIL) {\n- error = E_FAIL;\nbreak;\n+ case COJP_PARAMETERS_LABELS_JRCADDRESS:\n+ if (cojp_cbor_decode_ipv6_address(tmp, &ret, &(configuration->jrc_address)) == E_FAIL) {\n+ error++;\n}\ntmp += ret;\n+ break;\n+ default:\n+ // FIXME skip the unsupported parameter and go to the next one\n+ error++;\n+ }\n}\n- if ( (uint8_t)(tmp - buf) != len) { // final check that everything has been parsed\n- error = E_FAIL;\n- break;\n+ if ( (uint8_t)(tmp - buf) != len) { // final check that everything has been processed\n+ error++;\n}\n- } while(0); // while loop that gets executed only once\n- if (error == E_FAIL) {\n- memset(response, 0x00, sizeof(join_response_t)); // invalidate join response\n+ if (error) {\n+ memset(configuration, 0x00, sizeof(cojp_configuration_object_t));\n+ return E_FAIL;\n}\n- return error;\n+\n+ return E_SUCCESS;\n}\n//=========================== private =========================================\n/**\n-\\brief Parse the received COSE_Keyset.\n+\\brief Decode a Link-Layer Keyset object.\n-The function expects COSE_Keyset with symmetric keys as per minimal-security-02 draft\n-and parses it into COSE_symmetric_key_t structure.\n+The function expects Link-Layer Keyset object as defined in draft-ietf-6tisch-minimal-security-06\n+and parses it into a cojp_link_layer_keyset_t structure.\n-\\param[out] keyset The COSE_keyset_t structure containing parsed keys.\n\\param[in] buf Input buffer.\n\\param[out] len Processed length.\n+\\param[out] keyset The cojp_link_layer_keyset_t structure containing the parsed keys.\n+\\return E_SUCCESS if all elements are successfully processed, E_FAIL in all other cases.\n*/\n-owerror_t cbor_parse_keyset(COSE_keyset_t *keyset, uint8_t *buf, uint8_t* len) {\n+owerror_t cojp_cbor_decode_link_layer_keyset(uint8_t *buf, uint8_t* len, cojp_link_layer_keyset_t *keyset) {\ncbor_majortype_t major_type;\n- uint8_t additional_info;\n+ uint8_t add_info;\nuint8_t i;\n- uint8_t ret;\n+ uint8_t l;\nuint8_t *tmp;\n+ uint8_t tmp_key_usage; // 8-bit variant of key usage\n+ uint8_t ret;\n+ cojp_link_layer_key_t *current_key;\n+ uint8_t current_key_index;\n+\n+ current_key_index = 0;\n+ i = 0;\n+ ret = 0;\ntmp = buf;\nmajor_type = (cbor_majortype_t) *buf >> 5;\n- additional_info = *buf & CBOR_ADDINFO_MASK;\n+ add_info = *buf & CBOR_ADDINFO_MASK;\n+ // assert\nif (major_type != CBOR_MAJORTYPE_ARRAY) {\nreturn E_FAIL;\n}\n- if (additional_info > COSE_KEYSET_MAX_NUM_KEYS || additional_info == 0) {\n- return E_FAIL; // unsupported join response structure\n+ // sanity check\n+ if (add_info < COJP_KEY_MIN_NUM_ELEMS) { // additional info of an array is the number of elements\n+ return E_FAIL;\n}\ntmp++;\n- for(i = 0; i < additional_info; i++) {\n- // parse symmetric key map\n- if (cbor_parse_key(&keyset->key[i], tmp, &ret) == E_FAIL) {\n- return E_FAIL;\n- }\n- tmp += ret;\n- }\n+ while(i < add_info) { // while there are elements left in the array\n- *len = (uint8_t) (tmp - buf);\n- return E_SUCCESS;\n+ if (current_key_index >= KEYSET_MAX_NUM_KEYS) {\n+ return E_FAIL; // more keys than we can handle\n}\n-/**\n-\\brief Parse a COSE symmetric key.\n+ major_type = (cbor_majortype_t) *tmp >> 5;\n-The function expects COSE symmetric key as per minimal-security-02 draft\n-and parses it into COSE_symmetric_key_t structure.\n+ if (major_type == CBOR_MAJORTYPE_UINT) {\n-\\param[out] key The COSE_symmetric_ket_t structure containing parsed key.\n-\\param[in] buf Input buffer.\n-\\param[out] len Processed length.\n-*/\n-owerror_t cbor_parse_key(COSE_symmetric_key_t *key, uint8_t* buf, uint8_t* len) {\n+ current_key = (cojp_link_layer_key_t *) &(keyset->key[current_key_index]);\n- cbor_majortype_t major_type;\n- uint8_t additional_info;\n- uint8_t i;\n- uint8_t *tmp;\n- uint8_t l;\n+ ret = cbor_decode_uint(tmp, ¤t_key->key_index);\n+ tmp += ret;\n+ i++; // moving on to the next element\n- tmp = buf;\n- major_type = (cbor_majortype_t) *buf >> 5;\n- additional_info = *buf & CBOR_ADDINFO_MASK;\n+ major_type = (cbor_majortype_t) *tmp >> 5;\n+ l = *buf & CBOR_ADDINFO_MASK;\n- if (major_type != CBOR_MAJORTYPE_MAP) {\n- return E_FAIL;\n- }\n+ if (major_type == CBOR_MAJORTYPE_UINT) { // optional key usage as a uint is present\n+ ret = cbor_decode_uint(tmp, &tmp_key_usage);\n+ current_key->key_usage = (cojp_key_usage_values_t) tmp_key_usage;\n+ tmp += ret;\n+ i++;\n- if (additional_info > COSE_SYMKEY_MAXNUMPAIRS || additional_info == 0) {\n- return E_FAIL; // unsupported join response structure\n+ major_type = (cbor_majortype_t) *tmp >> 5;\n+ l = *buf & CBOR_ADDINFO_MASK;\n+ } else { // key usage is not present, implies the default value\n+ current_key->key_usage = COJP_KEY_USAGE_6TiSCH_K1K2_ENC_MIC32;\n}\n- tmp++;\n-\n- for (i = 0; i < additional_info; i++) {\n- switch((cose_key_label_t) *tmp) {\n- case COSE_KEY_LABEL_KTY:\n- tmp++;\n- key->kty = (cose_key_value_t) *tmp;\n- tmp++;\n- break;\n- case COSE_KEY_LABEL_ALG: // step by key alg\n- tmp++;\n- tmp++;\n- break;\n- case COSE_KEY_LABEL_KID:\n- tmp++;\n- l = *tmp & CBOR_ADDINFO_MASK;\n- if (l != COSE_SYMKEY_KEYID_LENGTH) {\n- return E_FAIL;\n+ if (major_type == CBOR_MAJORTYPE_BSTR) { // mandatory key_value parameter as a bstr\n+ if (l != AES128_KEY_LENGTH) {\n+ return E_FAIL; // unsupported\n}\ntmp++;\n- memcpy(key->kid, tmp, COSE_SYMKEY_KEYID_LENGTH);\n+ memcpy(current_key->key_value, tmp, AES128_KEY_LENGTH);\ntmp += l;\n- break;\n- case COSE_KEY_LABEL_K:\n- tmp++;\n- l = *tmp & CBOR_ADDINFO_MASK;\n- if (l!= COSE_SYMKEY_LENGTH) {\n+ i++; // moving on to the next element, if any\n+ } else { // last element in the group is not a bstr -> error\nreturn E_FAIL;\n}\n- tmp++;\n- memcpy(key->k, tmp, COSE_SYMKEY_LENGTH);\n- tmp += l;\n- break;\n- case COSE_KEY_LABEL_BASEIV: // step by base iv\n- tmp++;\n- l = *tmp & CBOR_ADDINFO_MASK;\n- tmp++;\n- tmp += l;\n- break;\n- case COSE_KEY_LABEL_KEYOPS: // step by key ops\n- tmp++;\n- l = *tmp & CBOR_ADDINFO_MASK;\n- tmp++;\n- tmp += l;\n- break;\n- default:\n+ } else { // first element in the group is not a uint -> error\nreturn E_FAIL;\n}\n+\n+ current_key_index++;\n}\n*len = (uint8_t) (tmp - buf);\n@@ -218,8 +199,10 @@ and parses it into short_address_t structure.\n\\param[out] address The short_address_t structure containing parsed short_address and lease time.\n\\param[in] buf Input buffer.\n\\param[out] len Processed length.\n+\\param[out] short_address The cojp_link_layer_short_address_t structure containing the parsed short address.\n+\\return E_SUCCESS in case of success, E_FAIL otherwise.\n*/\n-owerror_t cbor_parse_short_address(short_address_t *short_address, uint8_t *buf, uint8_t* len) {\n+owerror_t cojp_cbor_decode_link_layer_short_address(uint8_t *buf, uint8_t *len, cojp_link_layer_short_address_t *short_address) {\ncbor_majortype_t major_type;\nuint8_t additional_info;\n@@ -235,38 +218,106 @@ owerror_t cbor_parse_short_address(short_address_t *short_address, uint8_t *buf,\n}\nif (additional_info > 2 || additional_info == 0) {\n- return E_FAIL; // unsupported join response structure\n+ return E_FAIL; // unsupported Link-Layer Short Address object\n}\ntmp++;\n+ major_type = (cbor_majortype_t) *buf >> 5;\nl = *tmp & CBOR_ADDINFO_MASK;\n- if (l != SHORT_ADDRESS_LENGTH) {\n+ if (major_type != CBOR_MAJORTYPE_BSTR) { // first element is not a bst -> error\n+ return E_FAIL;\n+ }\n+\n+ if (l != IEEE802154_SHORT_ADDRESS_LENGTH) { // length of the bstr is not what IEEE802.15.4 expects\nreturn E_FAIL;\n}\ntmp++;\n- memcpy(short_address->address, tmp, SHORT_ADDRESS_LENGTH);\n+ memcpy(short_address->address, tmp, IEEE802154_SHORT_ADDRESS_LENGTH);\ntmp += l;\nif (additional_info == 2) { // lease time present\n- l = *tmp & CBOR_ADDINFO_MASK;\n- if (l != ASN_LENGTH) { // 5 byte ASN expected\n+ // TODO lease_time parsing unsupported for now, do nothing\n+ }\n+\n+ *len = (uint8_t) (tmp - buf);\n+ return E_SUCCESS;\n+}\n+\n+/**\n+\\brief Decodes a CBOR bstr to an IPv6 address.\n+\n+This functions attempts to decode a byte string buf into an IPv6 address, as an open_addr_t structure.\n+\n+\\param[in] buf The input buffer.\n+\\param[out] len The processed length.\n+\\param[out] ipv6_address The open_addr_t structure containing the parsed IPv6 address.\n+\\return E_SUCCESS in case of success, E_FAIL otherwise.\n+*/\n+owerror_t cojp_cbor_decode_ipv6_address(uint8_t *buf, uint8_t *len, open_addr_t *ipv6_address) {\n+ uint8_t major_type;\n+ uint8_t add_info;\n+ uint8_t *tmp;\n+\n+ major_type = (cbor_majortype_t) *buf >> 5;\n+ add_info = *buf & CBOR_ADDINFO_MASK;\n+ tmp = buf;\n+\n+ if (major_type != CBOR_MAJORTYPE_BSTR) { // Does not decode into a bstr -> error\nreturn E_FAIL;\n}\n+\n+ if (add_info != LENGTH_ADDR128b) {\n+ return E_FAIL; // length of the bstr is different than the length of an IPv6 address (16) - > error\n+ }\n+\ntmp++;\n- // ASN is in network byte order\n- (short_address->lease_asn).byte4 = tmp[0];\n- (short_address->lease_asn).bytes2and3 = ((uint16_t) tmp[1] << 8) | ((uint16_t) tmp[2]);\n- (short_address->lease_asn).bytes0and1 = ((uint16_t) tmp[3] << 8) | ((uint16_t) tmp[4]);\n+ ipv6_address->type = ADDR_128B;\n+ memcpy(ipv6_address->addr_128b, tmp, LENGTH_ADDR128b);\n- tmp += ASN_LENGTH;\n+ *len = (uint8_t) (tmp - buf);;\n+ return E_SUCCESS;\n}\n- *len = (uint8_t) (tmp - buf);\n- return E_SUCCESS;\n+/**\n+\\brief Decode a CBOR unsigned integer. Only supports 8-bit values.\n+\n+This functions attempts to decode a byte string buf into a CBOR unsigned integer.\n+\n+\n+\\param[in] buf The input buffer.\n+\\param[out] value The 8-bit decoded value.\n+\\return Length of the decoded unsigned integer, 0 if error.\n+*/\n+uint8_t cbor_decode_uint(uint8_t *buf, uint8_t *value) {\n+ uint8_t major_type;\n+ uint8_t add_info;\n+\n+ major_type = (cbor_majortype_t) *buf >> 5;\n+ add_info = *buf & CBOR_ADDINFO_MASK;\n+\n+ // assert\n+ if (major_type != CBOR_MAJORTYPE_UINT) {\n+ return 0;\n}\n+ if (add_info < 23) {\n+ *value = add_info;\n+ return 0 + 1;\n+ } else if (add_info == 24) { // uint8_t follows\n+ *value = buf[1];\n+ return 1 + 1;\n+ } else if (add_info == 25) { // uint16_t follows\n+ return 1 + 2;\n+ } else if (add_info == 26) { // uint32_t follows\n+ return 1 + 4;\n+ } else if (add_info == 27) { // uint64_t follows\n+ return 1 + 8;\n+ }\n+\n+ return 0;\n+}\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
cojp_cbor: Implement CBOR decoder for objects defined in minimal-security-06
|
491,609 |
01.06.2018 16:51:52
| -7,200 |
e7bc59f15b973eb4cd46bc9a184e72f805484d54
|
cojp_cbor: Rename cbor.[ch] tp cojp_cbor.[ch]
|
[
{
"change_type": "MODIFY",
"old_path": "openapps/SConscript",
"new_path": "openapps/SConscript",
"diff": "@@ -33,7 +33,7 @@ additionalSourceFiles = [\nos.path.join('opencoap','hmac.c'),\nos.path.join('opencoap','sha224-256.c'),\nos.path.join('opencoap','cborencoder.c'),\n- os.path.join('cjoin','cbor.c'),\n+ os.path.join('cjoin','cojp_cbor.c'),\n]\n# header files that should be included in the build other than\n@@ -42,7 +42,7 @@ additionalHeaderFiles = [\nos.path.join('opencoap','openoscoap.h'),\nos.path.join('opencoap','sha.h'),\nos.path.join('opencoap','cborencoder.h'),\n- os.path.join('cjoin','cbor.h'),\n+ os.path.join('cjoin','cojp_cbor.h'),\n]\n# additional apps the user wants to build\n"
},
{
"change_type": "RENAME",
"old_path": "openapps/cjoin/cbor.c",
"new_path": "openapps/cjoin/cojp_cbor.c",
"diff": "/*e\n\\brief A minimal CBOR parser implementation of draft-6tisch-minimal-security-02.\n*/\n-#include \"cbor.h\"\n+#include \"cojp_cbor.h\"\n//=========================== defines =========================================\n// number of bytes in 802.15.4 short address\n#define ASN_LENGTH 5\n"
},
{
"change_type": "RENAME",
"old_path": "openapps/cjoin/cbor.h",
"new_path": "openapps/cjoin/cojp_cbor.h",
"diff": ""
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
cojp_cbor: Rename cbor.[ch] tp cojp_cbor.[ch]
|
491,609 |
01.06.2018 16:52:16
| -7,200 |
ba44fbd6b8ab4a1999d38f797033d78dd0ba56ea
|
cojp_cbor: Add num_keys to the parsed keyset object
|
[
{
"change_type": "MODIFY",
"old_path": "openapps/cjoin/cojp_cbor.c",
"new_path": "openapps/cjoin/cojp_cbor.c",
"diff": "@@ -186,6 +186,7 @@ owerror_t cojp_cbor_decode_link_layer_keyset(uint8_t *buf, uint8_t* len, cojp_li\ncurrent_key_index++;\n}\n+ keyset->num_keys = current_key_index;\n*len = (uint8_t) (tmp - buf);\nreturn E_SUCCESS;\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "openapps/cjoin/cojp_cbor.h",
"new_path": "openapps/cjoin/cojp_cbor.h",
"diff": "@@ -80,6 +80,7 @@ typedef struct {\n} cojp_link_layer_key_t;\ntypedef struct {\n+ uint8_t num_keys;\ncojp_link_layer_key_t key[KEYSET_MAX_NUM_KEYS];\n} cojp_link_layer_keyset_t;\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
cojp_cbor: Add num_keys to the parsed keyset object
|
491,609 |
01.06.2018 16:58:47
| -7,200 |
55ac7931edff5edc129b3fbf013f1edd27e48474
|
cjoin: Initial update of the Join Message implementation compliant with minimal-security-06
|
[
{
"change_type": "MODIFY",
"old_path": "openapps/cjoin/cjoin.c",
"new_path": "openapps/cjoin/cjoin.c",
"diff": "#include \"idmanager.h\"\n#include \"IEEE802154E.h\"\n#include \"IEEE802154_security.h\"\n-#include \"cbor.h\"\n+#include \"cojp_cbor.h\"\n#include \"eui64.h\"\n#include \"neighbors.h\"\n@@ -126,7 +126,7 @@ owerror_t cjoin_receive(OpenQueueEntry_t* msg,\ncoap_option_iht* coap_outgoingOptions,\nuint8_t* coap_outgoingOptionsLen) {\n- join_response_t join_response;\n+ cojp_configuration_object_t configuration;\nowerror_t ret;\nopentimers_cancel(cjoin_vars.timerId); // cancel the retransmission timer\n@@ -135,12 +135,17 @@ owerror_t cjoin_receive(OpenQueueEntry_t* msg,\nreturn E_FAIL;\n}\n- ret = cbor_parse_join_response(&join_response, msg->payload, msg->length);\n+ ret = cojp_cbor_decode_configuration_object(msg->payload, msg->length, &configuration);\nif (ret == E_FAIL) { return E_FAIL; }\n+ if (configuration.keyset.num_keys == 1 &&\n+ configuration.keyset.key[0].key_usage == COJP_KEY_USAGE_6TiSCH_K1K2_ENC_MIC32) {\n// set the L2 keys as per the parsed value\n- IEEE802154_security_setBeaconKey(join_response.keyset.key[0].kid[0], join_response.keyset.key[0].k);\n- IEEE802154_security_setDataKey(join_response.keyset.key[0].kid[0], join_response.keyset.key[0].k);\n+ IEEE802154_security_setBeaconKey(configuration.keyset.key[0].key_index, configuration.keyset.key[0].key_value);\n+ IEEE802154_security_setDataKey(configuration.keyset.key[0].key_index, configuration.keyset.key[0].key_value);\n+ } else {\n+ // TODO not supported for now\n+ }\ncjoin_setIsJoined(TRUE); // declare join is over\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
cjoin: Initial update of the Join Message implementation compliant with minimal-security-06
|
491,609 |
04.06.2018 14:40:42
| -7,200 |
5460aed4245bd7099f6fa9571532d6956316895c
|
cjoin: Update OSCORE security context initialization to the latest spec and test description values
|
[
{
"change_type": "MODIFY",
"old_path": "openapps/cjoin/cjoin.c",
"new_path": "openapps/cjoin/cjoin.c",
"diff": "const uint8_t cjoin_path0[] = \"j\";\n-static const uint8_t masterSecret[] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, \\\n- 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f};\n+static const uint8_t masterSecret[] = {0xde, 0xad, 0xbe, 0xef, 0xca, 0xfe, 0xde, 0xad, \\\n+ 0xbe, 0xef, 0xca, 0xfe, 0xde, 0xad, 0xbe, 0xef};\nstatic const uint8_t jrcHostName[] = \"6tisch.arpa\";\n@@ -82,16 +82,18 @@ void cjoin_init(void) {\n}\nvoid cjoin_init_security_context(void) {\n- uint8_t senderID[9]; // needs to hold EUI-64 + 1 byte\n- uint8_t recipientID[9]; // needs to hold EUI-64 + 1 byte\n+ uint8_t senderID[1]; // 1 dummy byte\n+ uint8_t recipientID[3]; // 3 byte fixed value\n+ uint8_t id_context[8];\nuint8_t* joinKey;\n- eui64_get(senderID);\n- senderID[8] = 0x00; // construct sender ID according to the minimal-security-03 draft\n+ eui64_get(id_context);\n+ senderID[0] = 0x00; // construct sender ID according to the minimal-security-06 draft\neui64_get(recipientID);\n- recipientID[8] = 0x01; // construct recipient ID according to the minimal-security-03 draft\n+ recipientID[] = {0x4a, 0x52, 0x43}; // construct recipient ID according to the minimal-security-06 draft\nidmanager_getJoinKey(&joinKey);\n+ // TODO Pass id_context to the routine\nopenoscoap_init_security_context(&cjoin_vars.context,\nsenderID,\nsizeof(senderID),\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
cjoin: Update OSCORE security context initialization to the latest spec and test description values
|
491,609 |
04.06.2018 17:04:24
| -7,200 |
a0b02a29b9195ac66c0cbdbb894c9f9ab23efe0e
|
cborencoder: Update cborencoder library and align it with Wireshark project
|
[
{
"change_type": "MODIFY",
"old_path": "openapps/opencoap/cborencoder.c",
"new_path": "openapps/opencoap/cborencoder.c",
"diff": "/**\n-\\brief CBOR encoder library.\n-\n-\\author Martin Gunnarsson <martin.gunnarsson@ri.se>\n+\\brief CBOR encoding functions.\n+\\Author Martin Gunnarsson <martin.gunnarsson@ri.se>\n+\\author Modified by Malisa Vucinic <malishav@gmail.com>\n*/\n-\n#include \"cborencoder.h\"\n-uint8_t cborencoder_put_text(uint8_t **buffer, char *text, uint8_t text_len){\n+uint8_t\n+cborencoder_put_text(uint8_t *buffer, const char *text, uint8_t text_len) {\nuint8_t ret = 0;\nif(text_len > 23 ){\n- **buffer = 0x78;\n- (*buffer)++;\n- **buffer = text_len;\n- (*buffer)++;\n- ret += 2;\n+ buffer[ret++] = 0x78;\n+ buffer[ret++] = text_len;\n} else {\n- **buffer = (0x60 | text_len);\n- (*buffer)++;\n- ret += 1;\n+ buffer[ret++] = (0x60 | text_len);\n}\n- memcpy(*buffer, text, text_len);\n- (*buffer)+= text_len;\n+ if (text_len != 0 && text != NULL) {\n+ memcpy(&buffer[ret], text, text_len);\nret += text_len;\n+ }\n+\nreturn ret;\n}\n-uint8_t cborencoder_put_array(uint8_t **buffer,uint8_t elements){\n+uint8_t\n+cborencoder_put_array(uint8_t *buffer, uint8_t elements) {\n+ uint8_t ret = 0;\n+\nif(elements > 15){\nreturn 0;\n}\n- **buffer = (0x80 | elements);\n- (*buffer)++;\n- return 1;\n+ buffer[ret++] = (0x80 | elements);\n+ return ret;\n}\n-uint8_t cborencoder_put_bytes(uint8_t **buffer, uint8_t bytes_len, uint8_t *bytes){\n+uint8_t\n+cborencoder_put_bytes(uint8_t *buffer, const uint8_t *bytes, uint8_t bytes_len) {\nuint8_t ret = 0;\n+\nif(bytes_len > 23){\n- **buffer = 0x58;\n- (*buffer)++;\n- **buffer = bytes_len;\n- (*buffer)++;\n- ret += 2;\n+ buffer[ret++] = 0x58;\n+ buffer[ret++] = bytes_len;\n} else {\n- **buffer = (0x40 | bytes_len);\n- (*buffer)++;\n- ret += 1;\n+ buffer[ret++] = (0x40 | bytes_len);\n}\n- memcpy(*buffer, bytes, bytes_len);\n- (*buffer) += bytes_len;\n+\n+ if (bytes_len != 0 && bytes != NULL){\n+ memcpy(&buffer[ret], bytes, bytes_len);\nret += bytes_len;\n+ }\n+\nreturn ret;\n}\n-uint8_t cborencoder_put_map(uint8_t **buffer, uint8_t elements){\n- if(elements > 15){\n- return 0;\n+\n+uint8_t\n+cborencoder_put_unsigned(uint8_t *buffer, uint8_t value) {\n+ uint8_t ret = 0;\n+\n+ if(value > 0x17 ){\n+ buffer[ret++] = 0x18;\n+ buffer[ret++] = value;\n+ return ret;\n}\n- **buffer = (0xa0 | elements);\n- (*buffer)++;\n- return 1;\n+ buffer[ret++] = value;\n+ return ret;\n}\n-uint8_t cborencoder_put_unsigned(uint8_t **buffer, uint8_t value){\n- if(value > 0x17 ){\n- (**buffer) = (0x18);\n- (*buffer)++;\n- (**buffer) = (value);\n- (*buffer)++;\n- return 2;\n+uint8_t\n+cborencoder_put_null(uint8_t *buffer) {\n+ uint8_t ret = 0;\n+\n+ buffer[ret++] = 0xf6;\n+ return ret;\n+}\n+\n+uint8_t\n+cborencoder_put_map(uint8_t *buffer, uint8_t elements) {\n+ uint8_t ret = 0;\n+\n+ if(elements > 15){\n+ return 0;\n}\n- (**buffer) = (value);\n- (*buffer)++;\n- return 1;\n+\n+ buffer[ret++] = (0xa0 | elements);\n+ return ret;\n}\n+\n"
},
{
"change_type": "MODIFY",
"old_path": "openapps/opencoap/cborencoder.h",
"new_path": "openapps/opencoap/cborencoder.h",
"diff": "#include \"opendefs.h\"\n-uint8_t cborencoder_put_text(uint8_t **buffer, char *text, uint8_t text_len);\n-\n-uint8_t cborencoder_put_array(uint8_t **buffer,uint8_t elements);\n-\n-uint8_t cborencoder_put_bytes(uint8_t **buffer, uint8_t bytes_len, uint8_t *bytes);\n-\n-uint8_t cborencoder_put_map(uint8_t **buffer, uint8_t elements);\n-\n-uint8_t cborencoder_put_unsigned(uint8_t **buffer, uint8_t value);\n+/* CBOR encoder prototypes */\n+uint8_t cborencoder_put_text(uint8_t *buffer, const char *text, uint8_t text_len);\n+uint8_t cborencoder_put_null(uint8_t *buffer);\n+uint8_t cborencoder_put_unsigned(uint8_t *buffer, uint8_t value);\n+uint8_t cborencoder_put_bytes(uint8_t *buffer, const uint8_t *bytes, uint8_t bytes_len);\n+uint8_t cborencoder_put_array(uint8_t *buffer, uint8_t elements);\n+uint8_t cborencoder_put_map(uint8_t *buffer, uint8_t elements);\n#endif /* _CBORENCODER_H */\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
cborencoder: Update cborencoder library and align it with Wireshark project
|
491,609 |
04.06.2018 17:05:03
| -7,200 |
0c8b6e03c0fa44df42e4f663ce43728c56d32b57
|
openoscoap: Update the usage of cborencoder library in openoscoap.c
Remove trailing whitespaces.
|
[
{
"change_type": "MODIFY",
"old_path": "openapps/opencoap/openoscoap.c",
"new_path": "openapps/opencoap/openoscoap.c",
"diff": "@@ -510,27 +510,24 @@ owerror_t hkdf_derive_parameter(uint8_t* buffer,\nconst uint8_t key[] = \"Key\";\nuint8_t info[20];\nuint8_t infoLen;\n- uint8_t *temp;\nuint8_t ret;\n- temp = info;\n-\ninfoLen = 0;\n- infoLen += cborencoder_put_array(&temp, 4);\n- infoLen += cborencoder_put_bytes(&temp, identifierLen, identifier);\n- infoLen += cborencoder_put_unsigned(&temp, algorithm);\n+ infoLen += cborencoder_put_array(&info[infoLen], 4);\n+ infoLen += cborencoder_put_bytes(&info[infoLen], identifier, identifierLen);\n+ infoLen += cborencoder_put_unsigned(&info[infoLen], algorithm);\nif (type == OSCOAP_DERIVATION_TYPE_KEY) {\n- infoLen += cborencoder_put_text(&temp, (char *) key, sizeof(key)-1);\n+ infoLen += cborencoder_put_text(&info[infoLen], (char *) key, sizeof(key)-1);\n}\nelse if (type == OSCOAP_DERIVATION_TYPE_IV) {\n- infoLen += cborencoder_put_text(&temp, (char *) iv, sizeof(iv)-1);\n+ infoLen += cborencoder_put_text(&info[infoLen], (char *) iv, sizeof(iv)-1);\n}\nelse {\nreturn E_FAIL;\n}\n- infoLen += cborencoder_put_unsigned(&temp, length);\n+ infoLen += cborencoder_put_unsigned(&info[infoLen], length);\nret = hkdf(SHA256, masterSalt, masterSaltLen, masterSecret, masterSecretLen, info, infoLen, buffer, length);\n@@ -563,7 +560,6 @@ uint8_t openoscoap_construct_aad(uint8_t* buffer,\nuint8_t* requestSeq,\nuint8_t requestSeqLen\n) {\n- uint8_t* ptr;\nuint8_t externalAAD[EAAD_MAX_LEN];\nuint8_t externalAADLen;\nuint8_t ret;\n@@ -572,14 +568,13 @@ uint8_t openoscoap_construct_aad(uint8_t* buffer,\nret = 0;\nexternalAADLen = 0;\n- ptr = externalAAD;\n- externalAADLen += cborencoder_put_array(&ptr, 6);\n- externalAADLen += cborencoder_put_unsigned(&ptr, version);\n- externalAADLen += cborencoder_put_unsigned(&ptr, code);\n- externalAADLen += cborencoder_put_bytes(&ptr, optionsSerializedLen, optionsSerialized);\n- externalAADLen += cborencoder_put_unsigned(&ptr, aeadAlgorithm);\n- externalAADLen += cborencoder_put_bytes(&ptr, requestKidLen, requestKid);\n- externalAADLen += cborencoder_put_bytes(&ptr, requestSeqLen, requestSeq);\n+ externalAADLen += cborencoder_put_array(&externalAAD[externalAADLen], 6);\n+ externalAADLen += cborencoder_put_unsigned(&externalAAD[externalAADLen], version);\n+ externalAADLen += cborencoder_put_unsigned(&externalAAD[externalAADLen], code);\n+ externalAADLen += cborencoder_put_bytes(&externalAAD[externalAADLen], optionsSerialized, optionsSerializedLen);\n+ externalAADLen += cborencoder_put_unsigned(&externalAAD[externalAADLen], aeadAlgorithm);\n+ externalAADLen += cborencoder_put_bytes(&externalAAD[externalAADLen], requestKid, requestKidLen);\n+ externalAADLen += cborencoder_put_bytes(&externalAAD[externalAADLen], requestSeq, requestSeqLen);\nif (externalAADLen > EAAD_MAX_LEN) {\n// corruption\n@@ -591,14 +586,13 @@ uint8_t openoscoap_construct_aad(uint8_t* buffer,\nreturn 0;\n}\n- ptr = buffer;\n- ret += cborencoder_put_array(&ptr, 3); // COSE Encrypt0 structure with 3 elements\n+ ret += cborencoder_put_array(&buffer[ret], 3); // COSE Encrypt0 structure with 3 elements\n// first element: \"Encrypt0\"\n- ret += cborencoder_put_text(&ptr, (char *) encrypt0, sizeof(encrypt0) - 1);\n+ ret += cborencoder_put_text(&buffer[ret], (char *) encrypt0, sizeof(encrypt0) - 1);\n// second element: empty byte string\n- ret += cborencoder_put_bytes(&ptr, 0, NULL);\n+ ret += cborencoder_put_bytes(&buffer[ret], NULL, 0);\n// third element: external AAD from OSCOAP\n- ret += cborencoder_put_bytes(&ptr, externalAADLen, externalAAD);\n+ ret += cborencoder_put_bytes(&buffer[ret], externalAAD, externalAADLen);\nreturn ret;\n}\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
openoscoap: Update the usage of cborencoder library in openoscoap.c
Remove trailing whitespaces.
|
491,609 |
04.06.2018 17:05:29
| -7,200 |
a44b509cf88492b23f986701ff7871b92e3eea28
|
cojp_cbor: Implement CBOR Join_Request object encoding and data structs
|
[
{
"change_type": "MODIFY",
"old_path": "openapps/cjoin/cojp_cbor.c",
"new_path": "openapps/cjoin/cojp_cbor.c",
"diff": "/*e\n-\\brief A minimal CBOR parser implementation of draft-6tisch-minimal-security-02.\n+\\brief CBOR helper functions implementing decoding and encoding of structures defined in draft-6tisch-minimal-security-06.\n*/\n#include \"cojp_cbor.h\"\n+#include \"cborencoder.h\"\n+\n//=========================== defines =========================================\n// number of bytes in 802.15.4 short address\n#define ASN_LENGTH 5\n@@ -91,6 +93,39 @@ owerror_t cojp_cbor_decode_configuration_object(uint8_t *buf, uint8_t len, cojp_\nreturn E_SUCCESS;\n}\n+/**\n+\\brief Encode a Join_Request object.\n+\n+This functions encodes the cojp_join_request_object_t structure into a byte string.\n+\n+\n+\\param[out] buf The output buffer.\n+\\param[in] join_request The cojp_join_request_object_t data structure containing the Join_Request parameters.\n+\\return Length of the encoded object..\n+*/\n+uint8_t cojp_cbor_encode_join_request_object(uint8_t *buf, cojp_join_request_object_t *join_request) {\n+ uint8_t len;\n+ uint8_t elements;\n+\n+ len = 0;\n+ elements = 0;\n+\n+ if (join_request->role == COJP_ROLE_VALUE_6N) {\n+ elements = 1;\n+ } else {\n+ elements = 2;\n+ }\n+\n+ len += cborencoder_put_map(buf, elements);\n+ if (elements == 2) {\n+ len += cborencoder_put_unsigned(buf, (uint8_t) COJP_PARAMETERS_LABELS_ROLE);\n+ len += cborencoder_put_unsigned(buf, (uint8_t) join_request->role);\n+ }\n+ len += cborencoder_put_unsigned(buf, (uint8_t) COJP_PARAMETERS_LABELS_NETID);\n+ len += cborencoder_put_bytes(buf, (join_request->pan_id)->panid, LENGTH_ADDR16b);\n+\n+ return len;\n+}\n//=========================== private =========================================\n"
},
{
"change_type": "MODIFY",
"old_path": "openapps/cjoin/cojp_cbor.h",
"new_path": "openapps/cjoin/cojp_cbor.h",
"diff": "@@ -90,12 +90,17 @@ typedef struct {\nopen_addr_t jrc_address;\n} cojp_configuration_object_t;\n+typedef struct {\n+ cojp_role_values_t role;\n+ open_addr_t * pan_id;;\n+} cojp_join_request_object_t;\n//=========================== variables =======================================\n//=========================== prototypes ======================================\nowerror_t cojp_cbor_decode_configuration_object(uint8_t *buf, uint8_t len, cojp_configuration_object_t *configuration);\n+uint8_t cojp_cbor_encode_join_request_object(uint8_t *buf, cojp_join_request_object_t *join_request);\n/**\n\\}\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
cojp_cbor: Implement CBOR Join_Request object encoding and data structs
|
491,609 |
04.06.2018 17:05:56
| -7,200 |
5cfd7468fad35a0196b68a4d1a76869499a2b146
|
cjoin: Update Join Request CoAP message to minimal-security-06
|
[
{
"change_type": "MODIFY",
"old_path": "openapps/cjoin/cjoin.c",
"new_path": "openapps/cjoin/cjoin.c",
"diff": "@@ -86,10 +86,13 @@ void cjoin_init_security_context(void) {\nuint8_t recipientID[3]; // 3 byte fixed value\nuint8_t id_context[8];\nuint8_t* joinKey;\n+\neui64_get(id_context);\nsenderID[0] = 0x00; // construct sender ID according to the minimal-security-06 draft\n- eui64_get(recipientID);\n- recipientID[] = {0x4a, 0x52, 0x43}; // construct recipient ID according to the minimal-security-06 draft\n+ // construct recipient ID according to the minimal-security-06 draft\n+ recipientID[0] = 0x4a; // \"J\"\n+ recipientID[1] = 0x52; // \"R\"\n+ recipientID[2] = 0x43; // \"C\"\nidmanager_getJoinKey(&joinKey);\n@@ -219,6 +222,11 @@ owerror_t cjoin_sendJoinRequest(open_addr_t* joinProxy) {\nopen_addr_t* prefix;\nowerror_t outcome;\ncoap_option_iht options[5];\n+ uint8_t tmp[10];\n+ uint8_t payload_len;\n+ cojp_join_request_object_t join_request;\n+\n+ payload_len = 0;\n// immediately arm the retransmission timer\nopentimers_scheduleIn(cjoin_vars.timerId,\n@@ -269,11 +277,18 @@ owerror_t cjoin_sendJoinRequest(open_addr_t* joinProxy) {\nmemcpy(&pkt->l3_destinationAdd.addr_128b[0],prefix->prefix,8);\nmemcpy(&pkt->l3_destinationAdd.addr_128b[8],joinProxy->addr_64b,8); // set host to eui-64 of the join proxy\n+ // encode Join_Request object in the payload\n+ join_request.role = COJP_ROLE_VALUE_6N; // regular non-6LBR node\n+ join_request.pan_id = idmanager_getMyID(ADDR_PANID); // pre-configured PAN ID\n+ payload_len = cojp_cbor_encode_join_request_object(tmp, &join_request);\n+ packetfunctions_reserveHeaderSize(pkt, payload_len);\n+ memcpy(pkt->payload, tmp, payload_len);\n+\n// send\noutcome = opencoap_send(\npkt,\n- COAP_TYPE_CON,\n- COAP_CODE_REQ_GET,\n+ COAP_TYPE_NON,\n+ COAP_CODE_REQ_POST,\n0, // token len\noptions,\n4, // options len\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
cjoin: Update Join Request CoAP message to minimal-security-06
|
491,609 |
04.06.2018 17:51:28
| -7,200 |
34f7da4accd9ba314f0737b5879948b9278fbe1e
|
opencoap: Add payload marker before sending the request if payload is present
|
[
{
"change_type": "MODIFY",
"old_path": "openapps/opencoap/opencoap.c",
"new_path": "openapps/opencoap/opencoap.c",
"diff": "@@ -730,6 +730,12 @@ owerror_t opencoap_send(\nclass = COAP_OPTION_CLASS_U;\n}\n+ // add payload marker\n+ if (msg->length) {\n+ packetfunctions_reserveHeaderSize(msg, 1);\n+ msg->payload[0] = COAP_PAYLOAD_MARKER;\n+ }\n+\n// once header is reserved, encode the options to the openqueue payload buffer\nopencoap_options_encode(msg,\noptions,\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
opencoap: Add payload marker before sending the request if payload is present
|
491,609 |
04.06.2018 17:52:18
| -7,200 |
0d46182d6db093363a01c3e1a1ef970cb896c908
|
cojp_cbor: Align the usage with the changes to the cborencoder library API
|
[
{
"change_type": "MODIFY",
"old_path": "openapps/cjoin/cojp_cbor.c",
"new_path": "openapps/cjoin/cojp_cbor.c",
"diff": "@@ -116,13 +116,13 @@ uint8_t cojp_cbor_encode_join_request_object(uint8_t *buf, cojp_join_request_obj\nelements = 2;\n}\n- len += cborencoder_put_map(buf, elements);\n+ len += cborencoder_put_map(&buf[len], elements);\nif (elements == 2) {\n- len += cborencoder_put_unsigned(buf, (uint8_t) COJP_PARAMETERS_LABELS_ROLE);\n- len += cborencoder_put_unsigned(buf, (uint8_t) join_request->role);\n+ len += cborencoder_put_unsigned(&buf[len], (uint8_t) COJP_PARAMETERS_LABELS_ROLE);\n+ len += cborencoder_put_unsigned(&buf[len], (uint8_t) join_request->role);\n}\n- len += cborencoder_put_unsigned(buf, (uint8_t) COJP_PARAMETERS_LABELS_NETID);\n- len += cborencoder_put_bytes(buf, (join_request->pan_id)->panid, LENGTH_ADDR16b);\n+ len += cborencoder_put_unsigned(&buf[len], (uint8_t) COJP_PARAMETERS_LABELS_NETID);\n+ len += cborencoder_put_bytes(&buf[len], (join_request->pan_id)->panid, LENGTH_ADDR16b);\nreturn len;\n}\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
cojp_cbor: Align the usage with the changes to the cborencoder library API
|
491,609 |
26.06.2018 17:59:05
| -7,200 |
d409d2e3df57d22cf79c68db3f4b384a6aa47adb
|
opencoap: CoAP bug fix to match response to a request with 0-length token
|
[
{
"change_type": "MODIFY",
"old_path": "openapps/opencoap/opencoap.c",
"new_path": "openapps/opencoap/opencoap.c",
"diff": "@@ -368,7 +368,9 @@ void opencoap_receive(OpenQueueEntry_t* msg) {\nmemcmp(&coap_header.token[0],&temp_desc->last_request.token[0],coap_header.TKL)==0\n) {\n- if (coap_header.T==COAP_TYPE_ACK || coap_header.T==COAP_TYPE_RES) {\n+ if (coap_header.T==COAP_TYPE_ACK ||\n+ coap_header.T==COAP_TYPE_RES ||\n+ coap_header.TKL == 0) {\nif (coap_header.messageID==temp_desc->last_request.messageID) {\nfound=TRUE;\n}\n@@ -396,7 +398,6 @@ void opencoap_receive(OpenQueueEntry_t* msg) {\nreturn;\n}\n}\n-\ntemp_desc->callbackRx(msg,&coap_header,&coap_incomingOptions[0], NULL, NULL);\n}\n}\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
opencoap: CoAP bug fix to match response to a request with 0-length token
|
491,609 |
26.06.2018 18:17:58
| -7,200 |
6d81fe6ae1eb3a7db66966bf2c999674783e12ef
|
cojp_cbor: Bug fix in CBOR decoding of Link-layer keyset object
|
[
{
"change_type": "MODIFY",
"old_path": "openapps/cjoin/cojp_cbor.c",
"new_path": "openapps/cjoin/cojp_cbor.c",
"diff": "@@ -189,7 +189,7 @@ owerror_t cojp_cbor_decode_link_layer_keyset(uint8_t *buf, uint8_t* len, cojp_li\ni++; // moving on to the next element\nmajor_type = (cbor_majortype_t) *tmp >> 5;\n- l = *buf & CBOR_ADDINFO_MASK;\n+ l = *tmp & CBOR_ADDINFO_MASK;\nif (major_type == CBOR_MAJORTYPE_UINT) { // optional key usage as a uint is present\nret = cbor_decode_uint(tmp, &tmp_key_usage);\n@@ -198,7 +198,7 @@ owerror_t cojp_cbor_decode_link_layer_keyset(uint8_t *buf, uint8_t* len, cojp_li\ni++;\nmajor_type = (cbor_majortype_t) *tmp >> 5;\n- l = *buf & CBOR_ADDINFO_MASK;\n+ l = *tmp & CBOR_ADDINFO_MASK;\n} else { // key usage is not present, implies the default value\ncurrent_key->key_usage = COJP_KEY_USAGE_6TiSCH_K1K2_ENC_MIC32;\n}\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
cojp_cbor: Bug fix in CBOR decoding of Link-layer keyset object
|
491,609 |
26.06.2018 18:19:48
| -7,200 |
3e4f44479cc56cd2456dba1890d53a9f056ed461
|
cjoin: Expecting 2.04 Changed as a response to POST
|
[
{
"change_type": "MODIFY",
"old_path": "openapps/cjoin/cjoin.c",
"new_path": "openapps/cjoin/cjoin.c",
"diff": "@@ -131,12 +131,13 @@ owerror_t cjoin_receive(OpenQueueEntry_t* msg,\ncoap_option_iht* coap_outgoingOptions,\nuint8_t* coap_outgoingOptionsLen) {\n+\ncojp_configuration_object_t configuration;\nowerror_t ret;\nopentimers_cancel(cjoin_vars.timerId); // cancel the retransmission timer\n- if (coap_header->Code != COAP_CODE_RESP_CONTENT) {\n+ if (coap_header->Code != COAP_CODE_RESP_CHANGED) {\nreturn E_FAIL;\n}\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
cjoin: Expecting 2.04 Changed as a response to POST
|
491,609 |
27.06.2018 11:30:19
| -7,200 |
607d90b045351736335e89ea2b7b5a8645bdba28
|
cjoin: Join is successful only if parameters are recognized
|
[
{
"change_type": "MODIFY",
"old_path": "openapps/cjoin/cjoin.c",
"new_path": "openapps/cjoin/cjoin.c",
"diff": "@@ -149,13 +149,14 @@ owerror_t cjoin_receive(OpenQueueEntry_t* msg,\n// set the L2 keys as per the parsed value\nIEEE802154_security_setBeaconKey(configuration.keyset.key[0].key_index, configuration.keyset.key[0].key_value);\nIEEE802154_security_setDataKey(configuration.keyset.key[0].key_index, configuration.keyset.key[0].key_value);\n+ cjoin_setIsJoined(TRUE); // declare join is over\n+ return E_SUCCESS;\n} else {\n// TODO not supported for now\n}\n- cjoin_setIsJoined(TRUE); // declare join is over\n- return E_SUCCESS;\n+ return E_FAIL;\n}\n//timer fired, but we don't want to execute task in ISR mode\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
cjoin: Join is successful only if parameters are recognized
|
491,609 |
29.06.2018 12:20:15
| -7,200 |
47d80e2027d0b0bbef9592a82bd68e073e07db25
|
cojp_cbor: Remove unit tests of obsolete CBOR decoding routines
Unit test routines are obsolete with the update of CBOR structures in
minimal-security-06. Remove them from version control until they are
updated.
|
[
{
"change_type": "DELETE",
"old_path": "openapps/cjoin/tests/test_parseDumps.py",
"new_path": null,
"diff": "-import ctypes\n-import cbor\n-import binascii\n-\n-import pytest\n-\n-#============================ defines ===============================\n-\n-COSE_KEYSET_MAX_NUM_KEYS = 2\n-SHORT_ADDRESS_LENGTH = 2\n-COSE_SYMKEY_LENGTH = 16\n-COSE_SYMKEY_KEYID_LENGTH = 1\n-\n-# from http://stackoverflow.com/questions/24307022/how-to-compare-two-ctypes-objects-for-equality\n-class CtStruct(ctypes.Structure):\n- def __eq__(self, other):\n- for field in self._fields_:\n- attr_name = field[0]\n- a, b = getattr(self, attr_name), getattr(other, attr_name)\n- is_array = isinstance(a, ctypes.Array)\n- if is_array and a[:] != b[:] or not is_array and a != b:\n- return False\n- return True\n-\n- def __ne__(self, other):\n- for field in self._fields_:\n- attr_name = field[0]\n- a, b = getattr(self, attr_name), getattr(other, attr_name)\n- is_array = isinstance(a, ctypes.Array)\n- if is_array and a[:] != b[:] or not is_array and a != b:\n- return True\n- return False\n-\n-class asn_t(CtStruct):\n- _pack_ = 1\n- _fields_ = [\n- (\"byte4\", ctypes.c_uint8),\n- (\"bytes2and3\", ctypes.c_uint16),\n- (\"bytes0and1\", ctypes.c_uint16),\n- ]\n-\n- def print_values(self):\n- print(format(self.byte4,'02x'), format(self.bytes2and3, '02x'), format(self.bytes0and1,'02x'))\n-\n-class short_address_t(CtStruct):\n- _fields_ = [\n- (\"address\", ctypes.c_uint8 * SHORT_ADDRESS_LENGTH),\n- (\"lease_asn\", asn_t),\n- ]\n-\n- def print_values(self):\n- print(\"short address: \" + ''.join(format(x, '02x') for x in self.address))\n- self.lease_asn.print_values()\n-\n-class COSE_symmetric_key_t(CtStruct):\n- _fields_ = [\n- (\"kty\", ctypes.c_int), # enum\n- (\"kid\", ctypes.c_uint8 * COSE_SYMKEY_KEYID_LENGTH),\n- (\"k\", ctypes.c_uint8 * COSE_SYMKEY_LENGTH),\n- ]\n-\n- def print_values(self):\n- print \"kty: \" + str(self.kty)\n- print \"kid: \" + ''.join(format(x, '02x') for x in self.kid)\n- print \"k: \" + ''.join(format(x, '02x') for x in self.k)\n-\n-class COSE_keyset_t(CtStruct):\n- _fields_ = [\n- (\"key\", COSE_symmetric_key_t * COSE_KEYSET_MAX_NUM_KEYS),\n- ]\n-\n- def print_values(self):\n- for key in self.key:\n- print \"================\"\n- key.print_values()\n-\n-class join_response_t(CtStruct):\n- _fields_ = [\n- (\"keyset\", COSE_keyset_t),\n- (\"short_address\", short_address_t),\n- ]\n- def print_values(self):\n- self.keyset.print_values()\n- print \"================\"\n- self.short_address.print_values()\n-\n-#============================ fixtures ==============================\n-\n-CBORDUMPSANDPARSED = [\n- (\n- binascii.unhexlify('8281a301040241012050e6bf4287c2d7618d6a9687445ffd33e68142af93'),\n- ( 0, # return from parsing (success)\n- join_response_t( # parsed object\n- COSE_keyset_t(\n- (COSE_symmetric_key_t * COSE_KEYSET_MAX_NUM_KEYS) (\n- COSE_symmetric_key_t(\n- kty = 4,\n- kid = (ctypes.c_uint8 * 1)(0x01),\n- k = (ctypes.c_uint8 * 16) (0xe6, 0xbf, 0x42, 0x87, 0xc2, 0xd7, 0x61, 0x8d, 0x6a, 0x96, 0x87, 0x44, 0x5f, 0xfd, 0x33, 0xe6),\n- ),\n- COSE_symmetric_key_t(),\n- )\n- ),\n- short_address_t(\n- (ctypes.c_uint8 * SHORT_ADDRESS_LENGTH)(0xaf, 0x93)\n- )\n- ),\n- )\n- ),\n- (\n- binascii.unhexlify('8181a301040241012050e6bf4287c2d7618d6a9687445ffd33e6'),\n- ( 0, # return from parsing (success)\n- join_response_t( # parsed object\n- COSE_keyset_t(\n- (COSE_symmetric_key_t * COSE_KEYSET_MAX_NUM_KEYS) (\n- COSE_symmetric_key_t(\n- kty = 4,\n- kid = (ctypes.c_uint8 * 1)(0x01),\n- k = (ctypes.c_uint8 * 16) (0xe6, 0xbf, 0x42, 0x87, 0xc2, 0xd7, 0x61, 0x8d, 0x6a, 0x96, 0x87, 0x44, 0x5f, 0xfd, 0x33, 0xe6),\n- ),\n- COSE_symmetric_key_t(),\n- )\n- ),\n- ),\n- )\n- ),\n- (\n- binascii.unhexlify('8181a60104024101030c04840304090a0550abcdabcdabcdabcdabcdabcdabcdabcd2050e6bf4287c2d7618d6a9687445ffd33e6'), # key ops, alg and base iv present but ignored\n- ( 0, # return from parsing (success)\n- join_response_t( # parsed object\n- COSE_keyset_t(\n- (COSE_symmetric_key_t * COSE_KEYSET_MAX_NUM_KEYS) (\n- COSE_symmetric_key_t(\n- kty = 4,\n- kid = (ctypes.c_uint8 * 1)(0x01),\n- k = (ctypes.c_uint8 * 16) (0xe6, 0xbf, 0x42, 0x87, 0xc2, 0xd7, 0x61, 0x8d, 0x6a, 0x96, 0x87, 0x44, 0x5f, 0xfd, 0x33, 0xe6),\n- ),\n- COSE_symmetric_key_t(),\n- )\n- ),\n- ),\n- )\n- ),\n- (\n- binascii.unhexlify('8182a301040241012050e6bf4287c2d7618d6a9687445ffd33e6a301040241022050deadbeefdeadbeefdeadbeefdeadbeef'),\n- ( 0, # return from parsing (success)\n- join_response_t( # parsed object\n- COSE_keyset_t(\n- (COSE_symmetric_key_t * COSE_KEYSET_MAX_NUM_KEYS) (\n- COSE_symmetric_key_t(\n- kty = 4,\n- kid = (ctypes.c_uint8 * 1)(0x01),\n- k = (ctypes.c_uint8 * 16) (0xe6, 0xbf, 0x42, 0x87, 0xc2, 0xd7, 0x61, 0x8d, 0x6a, 0x96, 0x87, 0x44, 0x5f, 0xfd, 0x33, 0xe6),\n- ),\n- COSE_symmetric_key_t(\n- kty = 4,\n- kid = (ctypes.c_uint8 * 1)(0x02),\n- k = (ctypes.c_uint8 * 16) (0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef),\n- ),\n- )\n- ),\n- ),\n- )\n- ),\n- (\n- binascii.unhexlify('8282a301040241012050e6bf4287c2d7618d6a9687445ffd33e6a301040241022050deadbeefdeadbeefdeadbeefdeadbeef8142af93'),\n- ( 0, # return from parsing (success)\n- join_response_t( # parsed object\n- COSE_keyset_t(\n- (COSE_symmetric_key_t * COSE_KEYSET_MAX_NUM_KEYS) (\n- COSE_symmetric_key_t(\n- kty = 4,\n- kid = (ctypes.c_uint8 * 1)(0x01),\n- k = (ctypes.c_uint8 * 16) (0xe6, 0xbf, 0x42, 0x87, 0xc2, 0xd7, 0x61, 0x8d, 0x6a, 0x96, 0x87, 0x44, 0x5f, 0xfd, 0x33, 0xe6),\n- ),\n- COSE_symmetric_key_t(\n- kty = 4,\n- kid = (ctypes.c_uint8 * 1)(0x02),\n- k = (ctypes.c_uint8 * 16) (0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef),\n- ),\n- )\n- ),\n- short_address_t(\n- (ctypes.c_uint8 * SHORT_ADDRESS_LENGTH)(0xaf, 0x93)\n- )\n- ),\n- )\n- ),\n- (\n- binascii.unhexlify('8282a301040241012050e6bf4287c2d7618d6a9687445ffd33e6a301040241022050deadbeefdeadbeefdeadbeefdeadbeef8242af9345deadbeefab'),\n- ( 0, # return from parsing (success)\n- join_response_t( # parsed object\n- COSE_keyset_t(\n- (COSE_symmetric_key_t * COSE_KEYSET_MAX_NUM_KEYS) (\n- COSE_symmetric_key_t(\n- kty = 4,\n- kid = (ctypes.c_uint8 * 1)(0x01),\n- k = (ctypes.c_uint8 * 16) (0xe6, 0xbf, 0x42, 0x87, 0xc2, 0xd7, 0x61, 0x8d, 0x6a, 0x96, 0x87, 0x44, 0x5f, 0xfd, 0x33, 0xe6),\n- ),\n- COSE_symmetric_key_t(\n- kty = 4,\n- kid = (ctypes.c_uint8 * 1)(0x02),\n- k = (ctypes.c_uint8 * 16) (0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef),\n- ),\n- )\n- ),\n- short_address_t(\n- (ctypes.c_uint8 * SHORT_ADDRESS_LENGTH)(0xaf, 0x93),\n- (asn_t)(ctypes.c_uint8(0xde),ctypes.c_uint16(0xadbe),ctypes.c_uint16(0xefab))\n- )\n- ),\n- )\n- ),\n- (\n- binascii.unhexlify('8281a301040241012050e6bf4287c2d7618d6a9687445ffd33e68142'),\n- ( 1, # return from parsing (fail)\n- join_response_t(), # parsed object (zeroed out)\n- )\n- ),\n- (\n- binascii.unhexlify('81a301040241012050e6bf4287c2d7618d6a9687445ffd33e68142af93'),\n- ( 1, # return from parsing (fail)\n- join_response_t(), # parsed object (zeroed out)\n- )\n- ),\n- (\n- binascii.unhexlify('8281a3010402410120508142af93'),\n- ( 1, # return from parsing (fail)\n- join_response_t(), # parsed object (zeroed out)\n- )\n- ),\n- (\n- binascii.unhexlify('8281a3010402410120508142af93'),\n- ( 1, # return from parsing (fail)\n- join_response_t(), # parsed object (zeroed out)\n- )\n- ),\n-\n-]\n-\n-@pytest.fixture(params=CBORDUMPSANDPARSED)\n-def cborDumpsAndParsed(request):\n- return request.param\n-\n-#============================ tests =================================\n-\n-def test_parseCborDumps(cborDumpsAndParsed):\n-\n- (input, output) = cborDumpsAndParsed\n-\n- test_lib = ctypes.cdll.LoadLibrary('libcbor.so')\n-\n- dump = [ord(b) for b in input]\n- arr = (ctypes.c_uint8 * len(dump))(*dump)\n- plen = ctypes.c_uint8(len(dump))\n-\n- result = join_response_t()\n-\n- ret = test_lib.cbor_parse_join_response(ctypes.byref(result), ctypes.byref(arr), plen)\n-\n- assert ret == output[0]\n- assert result == output[1]\n-\n-\n-def main():\n- lib = ctypes.cdll.LoadLibrary('libcbor.so')\n- join_response_parsed = join_response_t()\n-\n- join_response_serialized = binascii.unhexlify('8281a3010402410120508142af93')\n-\n- respPayload = [ord(b) for b in join_response_serialized]\n- arr = (ctypes.c_uint8 * len(respPayload))(*respPayload)\n- plen = ctypes.c_uint8(len(respPayload))\n-\n- print lib.cbor_parse_join_response(ctypes.byref(join_response_parsed), ctypes.byref(arr), plen)\n-\n- #test_jr.print_values()\n- join_response_parsed.print_values()\n-\n-\n-if __name__ == '__main__':\n- main()\n-\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
cojp_cbor: Remove unit tests of obsolete CBOR decoding routines
Unit test routines are obsolete with the update of CBOR structures in
minimal-security-06. Remove them from version control until they are
updated.
|
491,609 |
14.06.2018 16:37:49
| -7,200 |
bc648a941b3d99962f20f4558f3c133fcc74cdee
|
cjoin: Disable the use of OSCORE until the implementation is updated
|
[
{
"change_type": "MODIFY",
"old_path": "openapps/cjoin/cjoin.c",
"new_path": "openapps/cjoin/cjoin.c",
"diff": "@@ -65,7 +65,8 @@ void cjoin_init(void) {\ncjoin_vars.desc.path1len = 0;\ncjoin_vars.desc.path1val = NULL;\ncjoin_vars.desc.componentID = COMPONENT_CJOIN;\n- cjoin_vars.desc.securityContext = &cjoin_vars.context;\n+// cjoin_vars.desc.securityContext = &cjoin_vars.context;\n+ cjoin_vars.desc.securityContext = NULL;\ncjoin_vars.desc.discoverable = TRUE;\ncjoin_vars.desc.callbackRx = &cjoin_receive;\ncjoin_vars.desc.callbackSendDone = &cjoin_sendDone;\n@@ -208,7 +209,7 @@ void cjoin_task_cb(void) {\n// init the security context only here in order to use the latest joinKey\n// that may be set over the serial\n- cjoin_init_security_context();\n+// cjoin_init_security_context();\ncjoin_sendJoinRequest(joinProxy);\n@@ -265,12 +266,12 @@ owerror_t cjoin_sendJoinRequest(open_addr_t* joinProxy) {\n// object security option\n// length and value are set by the CoAP library\n- options[2].type = COAP_OPTION_NUM_OBJECTSECURITY;\n+// options[2].type = COAP_OPTION_NUM_OBJECTSECURITY;\n// ProxyScheme set to \"coap\"\n- options[3].type = COAP_OPTION_NUM_PROXYSCHEME;\n- options[3].length = sizeof(proxyScheme)-1;\n- options[3].pValue = (uint8_t *)proxyScheme;\n+ options[2].type = COAP_OPTION_NUM_PROXYSCHEME;\n+ options[2].length = sizeof(proxyScheme)-1;\n+ options[2].pValue = (uint8_t *)proxyScheme;\n// metadata\npkt->l4_destination_port = WKP_UDP_COAP;\n@@ -293,7 +294,7 @@ owerror_t cjoin_sendJoinRequest(open_addr_t* joinProxy) {\nCOAP_CODE_REQ_POST,\n0, // token len\noptions,\n- 4, // options len\n+ 3, // options len\n&cjoin_vars.desc\n);\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
cjoin: Disable the use of OSCORE until the implementation is updated
|
491,609 |
29.06.2018 12:34:55
| -7,200 |
894f6c57700650540cd7e1a08d82e8220ec1ce23
|
cjoin: Enable cjoin by default and fix a warning
|
[
{
"change_type": "MODIFY",
"old_path": "openapps/SConscript",
"new_path": "openapps/SConscript",
"diff": "@@ -6,7 +6,7 @@ localEnv = env.Clone()\n#===== retrieve the list of apps to build\n-defaultApps = []\n+defaultApps = ['cjoin']\nif localEnv['board']=='python':\ndefaultApps += [\n'c6t',\n@@ -21,7 +21,6 @@ if localEnv['board']=='python':\n'rrt',\n'cexample',\n'cstorm',\n- 'cjoin',\n]\n# source files that should be included in the build other than\n@@ -54,11 +53,11 @@ else:\n# union of default and additional apps (without duplicates)\napps = ['opencoap']\napps += sorted(list(set(defaultApps+userApps)))\n-if userApps:\n+\nappsInit = ['opencoap'] # make sure opencoap is initialized first\n+appsInit += ['cjoin'] # enable cjoin by defualt\n+if userApps:\nappsInit += sorted(list(set(userApps)))\n-else:\n- appsInit = []\n#===== rule to create a (temporary) openapps_dyn.c file\n"
},
{
"change_type": "MODIFY",
"old_path": "openapps/cjoin/cjoin.c",
"new_path": "openapps/cjoin/cjoin.c",
"diff": "@@ -37,7 +37,7 @@ static const uint8_t proxyScheme[] = \"coap\";\ncjoin_vars_t cjoin_vars;\n//=========================== prototypes ======================================\n-void cjoin_init_security_context();\n+void cjoin_init_security_context(void);\nowerror_t cjoin_receive(OpenQueueEntry_t* msg,\ncoap_header_iht* coap_header,\n"
},
{
"change_type": "MODIFY",
"old_path": "openapps/openapps.c",
"new_path": "openapps/openapps.c",
"diff": "@@ -37,7 +37,7 @@ void openapps_init(void) {\n//c6t_init();\ncinfo_init();\ncleds__init();\n- //cjoin_init();\n+ cjoin_init();\ncwellknown_init();\n//rrt_init();\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
cjoin: Enable cjoin by default and fix a warning
|
491,609 |
29.06.2018 15:45:55
| -7,200 |
49a85909a4809489b5adab1815d7e2b70f30eff0
|
cjoin: Always send to link-local address when joining
|
[
{
"change_type": "MODIFY",
"old_path": "openapps/cjoin/cjoin.c",
"new_path": "openapps/cjoin/cjoin.c",
"diff": "@@ -222,7 +222,6 @@ void cjoin_sendDone(OpenQueueEntry_t* msg, owerror_t error) {\nowerror_t cjoin_sendJoinRequest(open_addr_t* joinProxy) {\nOpenQueueEntry_t* pkt;\n- open_addr_t* prefix;\nowerror_t outcome;\ncoap_option_iht options[5];\nuint8_t tmp[10];\n@@ -276,8 +275,9 @@ owerror_t cjoin_sendJoinRequest(open_addr_t* joinProxy) {\n// metadata\npkt->l4_destination_port = WKP_UDP_COAP;\npkt->l3_destinationAdd.type = ADDR_128B;\n- prefix = idmanager_getMyID(ADDR_PREFIX); // at this point, this is link-local prefix\n- memcpy(&pkt->l3_destinationAdd.addr_128b[0],prefix->prefix,8);\n+ pkt->l3_destinationAdd.addr_128b[0] = 0xfe;\n+ pkt->l3_destinationAdd.addr_128b[1] = 0x80;\n+ memset(&pkt->l3_destinationAdd.addr_128b[2], 0x00, 6);\nmemcpy(&pkt->l3_destinationAdd.addr_128b[8],joinProxy->addr_64b,8); // set host to eui-64 of the join proxy\n// encode Join_Request object in the payload\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
cjoin: Always send to link-local address when joining
|
491,609 |
29.06.2018 16:17:14
| -7,200 |
37272fe864908c27e924b8c2fa8d97d5e0845b77
|
cjoin: Update comment and a reference to the correct draft version
|
[
{
"change_type": "MODIFY",
"old_path": "openapps/cjoin/cjoin.c",
"new_path": "openapps/cjoin/cjoin.c",
"diff": "/**\n-\\brief CoAP application implementing Simple Join Protocol from minimal-security-02 draft.\n+\\brief Implementation of Constrained Join Protocol (CoJP) from minimal-security-06 draft.\n*/\n#include \"opendefs.h\"\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
cjoin: Update comment and a reference to the correct draft version
|
491,595 |
29.06.2018 16:58:26
| -7,200 |
52244648f552b444b8e2ff5714a83762c7abe5b5
|
disable gina and z1 since the code doesn't fit the micro-controller. (revert this commit after issue resolved)
|
[
{
"change_type": "MODIFY",
"old_path": ".travis.yml",
"new_path": ".travis.yml",
"diff": "@@ -31,8 +31,8 @@ script:\n- scons board=openmote-b toolchain=armgcc verbose=1 oos_openwsn\n# - scons board=wsn430v14 toolchain=mspgcc verbose=1 oos_openwsn\n# - scons board=wsn430v13b toolchain=mspgcc verbose=1 oos_openwsn\n-- scons board=gina toolchain=mspgcc verbose=1 oos_openwsn\n-- scons board=z1 toolchain=mspgcc verbose=1 oos_openwsn\n+# - scons board=gina toolchain=mspgcc verbose=1 oos_openwsn\n+# - scons board=z1 toolchain=mspgcc verbose=1 oos_openwsn\n- scons board=python toolchain=gcc verbose=1 oos_openwsn\n- scons board=iot-lab_M3 toolchain=armgcc verbose=1 oos_openwsn\n- scons board=iot-lab_A8-M3 toolchain=armgcc verbose=1 oos_openwsn\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
disable gina and z1 since the code doesn't fit the micro-controller. (revert this commit after issue FW-764 resolved)
|
491,605 |
03.07.2018 10:48:09
| -7,200 |
477943219d26fa312975d3a7ef3c408195d074d0
|
Clock management changed
Removed UART debug prints
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/nrf52840dk/board.c",
"new_path": "bsp/boards/nrf52840dk/board.c",
"diff": "*/\n#include \"sdk/modules/nrfx/hal/nrf_power.h\"\n-#include \"sdk/modules/nrfx/drivers/include/nrfx_clock.h\"\n#include \"sdk/components/libraries/pwr_mgmt/nrf_pwr_mgmt.h\"\n+#include \"sdk/integration/nrfx/legacy/nrf_drv_clock.h\"\n#include \"sdk/components/libraries/delay/nrf_delay.h\"\n#include \"sdk/modules/nrfx/mdk/nrf52840.h\"\n//=========================== prototypes ======================================\nstatic void button_init(void);\n+\n+#if 0\nstatic void clock_event_handler(nrfx_clock_evt_type_t event);\n+#endif\n//=========================== main ============================================\n@@ -49,11 +52,14 @@ int main(void)\nvoid board_init(void)\n{\n// start low-frequency clock (LFCLK)\n- nrfx_clock_init(clock_event_handler);\n- nrfx_clock_lfclk_start();\n+ nrf_drv_clock_init();\n+ nrf_drv_clock_lfclk_request(NULL);\n+ while (!nrf_drv_clock_lfclk_is_running()) { }\n// put low-frequency clock into ultra low power (ULP) mode (will NOT work on the older nRF52832)\n- NRF_CLOCK->LFRCMODE= (CLOCK_LFRCMODE_MODE_ULP & CLOCK_LFRCMODE_MODE_Msk) << CLOCK_LFRCMODE_MODE_Pos;\n+ // NRF_CLOCK->LFRCMODE= (CLOCK_LFRCMODE_MODE_ULP & CLOCK_LFRCMODE_MODE_Msk) << CLOCK_LFRCMODE_MODE_Pos;\n+\n+ leds_init();\n// enable on-board DC-DC converter to reduce overall consumption (this also disables the LDO [low-dropout] regulator)\n// This only works if the required coil and condenser are properly connected to the pins DCC and DEC4, which is the\n@@ -61,9 +67,6 @@ void board_init(void)\n// circuitry, the CPU will hang.)\nnrf_power_dcdcen_set(true);\n- // start high frequency clock (HFCLK) ///< @todo: Revise, whether it is really needed.\n- nrfx_clock_hfclk_start();\n-\n// initialize power management library\nnrf_pwr_mgmt_init();\n@@ -73,26 +76,23 @@ void board_init(void)\nbutton_init();\n- leds_init();\n- uart_writeByte('L'); nrf_delay_ms(10); ///< DEBUG, REMOVE ME!\n- uart_writeByte(48+LEDS_NUMBER); nrf_delay_ms(10);\n+ // uart_writeByte('L'); nrf_delay_ms(10); ///< DEBUG, REMOVE ME!\n+ // uart_writeByte(48+LEDS_NUMBER); nrf_delay_ms(10);\ndebugpins_init();\n- uart_writeByte('D'); nrf_delay_ms(10); ///< DEBUG, REMOVE ME!\n+ // uart_writeByte('D'); nrf_delay_ms(10); ///< DEBUG, REMOVE ME!\n// bsp_timer_init(); ///< OBSOLETE, use sctimer instead\nsctimer_init();\n- uart_writeByte('T'); nrf_delay_ms(10); ///< DEBUG, REMOVE ME!\n+ // uart_writeByte('T'); nrf_delay_ms(10); ///< DEBUG, REMOVE ME!\n// radiotimer_init();\n-// radio_init();\n+ radio_init();\nspi_init();\n- uart_writeByte('S'); nrf_delay_ms(10); ///< DEBUG, REMOVE ME!\n+ // uart_writeByte('S'); nrf_delay_ms(10); ///< DEBUG, REMOVE ME!\n- radio_init();\n-\n- uart_writeByte('~'); ///< DEBUG, REMOVE ME!\n+ // uart_writeByte('~'); ///< DEBUG, REMOVE ME!\n}\n/**\n@@ -139,6 +139,7 @@ static void button_init(void)\n//=========================== interrupt handlers ==============================\n+#if 0\nstatic void clock_event_handler(nrfx_clock_evt_type_t event)\n{\nswitch(event)\n@@ -162,3 +163,4 @@ static void clock_event_handler(nrfx_clock_evt_type_t event)\n}\n}\n+#endif\n\\ No newline at end of file\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
- Clock management changed
- Removed UART debug prints
|
491,605 |
03.07.2018 10:54:03
| -7,200 |
5b5b76b4c881b81380a24c5d82f345406611c48d
|
Removed app_timer dependence
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/nrf52840dk/app_config.h",
"new_path": "bsp/boards/nrf52840dk/app_config.h",
"diff": "// clock\n#define CLOCK_ENABLED 1\n-#define NRFX_CLOCK_ENABLED 1\n+// #define NRFX_CLOCK_ENABLED 1\n// UART\n#define UART_ENABLED 1\n// #define TIMER0_USE_EASY_DMA 0\n// enable the app_timer library (based on RTC1 [Real Time Counter]) to be used as TIMER\n-#define APP_TIMER_ENABLED 1\n+// #define APP_TIMER_ENABLED 1\n#define RTC_ENABLED 1 // solely for legacy driver calls (if any)\n#define RTC0_ENABLED 1 // solely for legacy driver calls (if any)\n#define NRFX_RTC_ENABLED 1\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
- Removed app_timer dependence
|
491,605 |
03.07.2018 10:54:46
| -7,200 |
fc01b040f4fe0db23b7a291fc45fd1c0597e80b3
|
Removed unnecessary (and unused) methods.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/nrf52840dk/sctimer.c",
"new_path": "bsp/boards/nrf52840dk/sctimer.c",
"diff": "typedef struct\n{\nsctimer_cbt cb;\n- sctimer_capture_cbt startFrameCb;\n- sctimer_capture_cbt endFrameCb;\nuint8_t f_SFDreceived;\nuint32_t counter_MSB; ///< the first 8 bits of the 32 bit counter (which do not exist in the physical timer)\nuint32_t cc32bit_MSB; ///< the first 8 bits of the 32 bit CC (capture and compare) value, set\n@@ -93,16 +91,6 @@ void sctimer_set_callback(sctimer_cbt cb)\nsctimer_vars.cb= cb;\n}\n-void sctimer_setStartFrameCb(sctimer_capture_cbt cb)\n-{\n- sctimer_vars.startFrameCb= cb;\n-}\n-\n-void sctimer_setEndFrameCb(sctimer_capture_cbt cb)\n-{\n- sctimer_vars.endFrameCb= cb;\n-}\n-\n/**\n\\brief set compare interrupt\n*/\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
Removed unnecessary (and unused) methods.
|
491,605 |
03.07.2018 10:57:31
| -7,200 |
d8451ef311b363bc26200433251b3b93f44c2e64
|
Changed the usage of sctimer in a more proper way (was the example already obsolete???)
|
[
{
"change_type": "MODIFY",
"old_path": "projects/common/01bsp_radio_tx/01bsp_radio_tx.c",
"new_path": "projects/common/01bsp_radio_tx/01bsp_radio_tx.c",
"diff": "@@ -18,11 +18,12 @@ remainder of the packet contains an incrementing bytes.\n#include \"radio.h\"\n#include \"leds.h\"\n#include \"sctimer.h\"\n+#include \"uart.h\"\n//=========================== defines =========================================\n#define LENGTH_PACKET 125+LENGTH_CRC // maximum length is 127 bytes\n-#define CHANNEL 11 // 11 = 2.405GHz\n+#define CHANNEL 13 // 11 = 2.405GHz\n#define TIMER_PERIOD (32768>>1) // (32768>>1) = 500ms @ 32kHz\n//=========================== variables =======================================\n@@ -77,25 +78,27 @@ int mote_main(void) {\nradio_rfOff();\n// start periodic overflow\n- sctimer_setCompare(TIMER_PERIOD);\n+ sctimer_setCompare(sctimer_readCounter()+TIMER_PERIOD);\nsctimer_enable();\n- while(1) {\n-\n+ while(1)\n+ {\n// wait for timer to elapse\napp_vars.txpk_txNow = 0;\n- while (app_vars.txpk_txNow==0) {\n+ while (app_vars.txpk_txNow==0)\n+ {\nboard_sleep();\n}\n// led\n- leds_error_toggle();\n+ leds_radio_toggle();\n// prepare packet\napp_vars.txpk_num++;\napp_vars.txpk_len = sizeof(app_vars.txpk_buf);\napp_vars.txpk_buf[0] = app_vars.txpk_num;\n- for (i=1;i<app_vars.txpk_len;i++) {\n+ for (i=1;i<app_vars.txpk_len;i++)\n+ {\napp_vars.txpk_buf[i] = i;\n}\n@@ -114,13 +117,17 @@ void cb_radioTimerCompare(void) {\napp_dbg.num_radioTimerCompare++;\n}\n-void cb_radioTimerOverflows(void) {\n+void cb_radioTimerOverflows(void)\n+{\n+ // leds_debug_toggle();\n// update debug vals\napp_dbg.num_radioTimerOverflows++;\n// ready to send next packet\napp_vars.txpk_txNow = 1;\n+\n+ sctimer_setCompare(sctimer_readCounter()+TIMER_PERIOD);\n}\nvoid cb_startFrame(PORT_TIMER_WIDTH timestamp) {\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
Changed the usage of sctimer in a more proper way (was the example already obsolete???)
|
491,605 |
03.07.2018 10:58:04
| -7,200 |
f0350b5113b1a4fc5dccd8d75de2d022a9318d52
|
Added the required rxNow() call ... (was the example already obsolete???)
|
[
{
"change_type": "MODIFY",
"old_path": "projects/common/01bsp_radio_rx/01bsp_radio_rx.c",
"new_path": "projects/common/01bsp_radio_rx/01bsp_radio_rx.c",
"diff": "@@ -73,7 +73,7 @@ len=17 num=84 rssi=-81 lqi=108 crc=1\n//=========================== defines =========================================\n#define LENGTH_PACKET 125+LENGTH_CRC ///< maximum length is 127 bytes\n-#define CHANNEL 11 ///< 11 = 2.405GHz\n+#define CHANNEL 13 ///< 11 = 2.405GHz\n#define LENGTH_SERIAL_FRAME 8 ///< length of the serial frame\n//=========================== variables =======================================\n@@ -128,8 +128,8 @@ int mote_main(void) {\nboard_init();\n// add callback functions radio\n- sctimer_setStartFrameCb(cb_startFrame);\n- sctimer_setEndFrameCb(cb_endFrame);\n+ radio_setStartFrameCb(cb_startFrame);\n+ radio_setEndFrameCb(cb_endFrame);\n// setup UART\nuart_setCallbacks(cb_uartTxDone,cb_uartRxCb);\n@@ -140,11 +140,15 @@ int mote_main(void) {\n// switch in RX\nradio_rxEnable();\n+ radio_rxNow();\nwhile (1) {\n// sleep while waiting for at least one of the rxpk_done to be set\napp_vars.rxpk_done = 0;\n+\n+ leds_debug_toggle();\n+\nwhile (app_vars.rxpk_done==0) {\nboard_sleep();\n}\n@@ -188,6 +192,8 @@ int mote_main(void) {\nvoid cb_startFrame(PORT_TIMER_WIDTH timestamp) {\n+ leds_sync_on();\n+\n// update debug stats\napp_dbg.num_startFrame++;\n}\n@@ -199,8 +205,6 @@ void cb_endFrame(PORT_TIMER_WIDTH timestamp) {\n// indicate I just received a packet\napp_vars.rxpk_done = 1;\n- leds_sync_on();\n-\n// get packet from radio\nradio_getReceivedFrame(\napp_vars.rxpk_buf,\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
Added the required rxNow() call ... (was the example already obsolete???)
|
491,605 |
03.07.2018 10:58:52
| -7,200 |
89cf07ca946b54f455a2e6d3a2ea110de7b6f2b8
|
Radio RX, TX now working.
802.15.4 timings in board_info.h still need to be measured and adjusted.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/nrf52840dk/SConscript",
"new_path": "bsp/boards/nrf52840dk/SConscript",
"diff": "@@ -8,6 +8,9 @@ Import('env')\nlocalEnv = env.Clone()\n+# Glob('sdk/components/proprietary_rf/esb/nrf_esb.c') + \\\n+# Glob('sdk/components/libraries/timer/app_timer.c') + \\\n+\nsource = \\\nGlob('sdk/components/boards/boards.c') + \\\nGlob('sdk/components/libraries/experimental_section_vars/*.c') + \\\n@@ -16,6 +19,7 @@ source = \\\nGlob('sdk/components/libraries/util/app_util_platform.c') + \\\nGlob('sdk/integration/nrfx/legacy/nrf_drv_uart.c') + \\\nGlob('sdk/modules/nrfx/drivers/src/nrfx_clock.c') + \\\n+ Glob('sdk/integration/nrfx/legacy/nrf_drv_clock.c') + \\\nGlob('sdk/modules/nrfx/drivers/src/nrfx_power.c') + \\\nGlob('sdk/modules/nrfx/drivers/src/nrfx_rtc.c') + \\\nGlob('sdk/modules/nrfx/drivers/src/nrfx_spi.c') + \\\n@@ -23,8 +27,6 @@ source = \\\nGlob('sdk/modules/nrfx/mdk/gcc_startup_nrf52840.S') + \\\nGlob('sdk/modules/nrfx/mdk/system_nrf52840.c') + \\\nGlob('sdk/components/drivers_nrf/radio_config/radio_config.c') + \\\n- Glob('sdk/components/proprietary_rf/esb/nrf_esb.c') + \\\n- Glob('sdk/components/libraries/timer/app_timer.c') + \\\nGlob('*.c')\nlocalEnv.Append(\n@@ -55,9 +57,6 @@ localEnv.Append(\nos.path.join('#','bsp','boards','nrf52840dk','sdk','modules','nrfx','soc'),\nos.path.join('#','bsp','boards','nrf52840dk','sdk','modules','nrfx','templates'),\nos.path.join('#','bsp','boards','nrf52840dk','sdk','components','drivers_nrf','radio_config'),\n-# os.path.join('#','bsp','boards','nrf52840dk','sdk','components','proprietary_rf','esb'),\n- os.path.join('#','bsp','boards','nrf52840dk','sdk','components','libraries','timer'),\n-# os.path.join('#','bsp','boards','nrf52840dk','sdk','modules','nrfx','templates','nRF52840'),\n],\n)\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/nrf52840dk/board_info.h",
"new_path": "bsp/boards/nrf52840dk/board_info.h",
"diff": "#define PORT_PIN_RADIO_RESET_LOW() // nothing\n//===== IEEE802154E timing\n-#ifdef GOLDEN_IMAGE_ROOT\n+\n+#define SLOTDURATION 10 // in miliseconds\n+\n+#if SLOTDURATION==10\n// time-slot related\n#define PORT_TsSlotDuration 328 // counter counts one extra count, see datasheet\n// execution speed related\n#define PORT_maxTxAckPrepare 10 // 122us (measured 94us)\n// radio speed related\n#ifdef L2_SECURITY_ACTIVE\n-#define PORT_delayTx 7 // 366us (measured xxxus)\n+ #define PORT_delayTx 14 // 366us (measured xxxus)\n#else\n#define PORT_delayTx 12 // 366us (measured xxxus)\n#endif\n#define PORT_delayRx 0 // 0us (can not measure)\n// radio watchdog\n-#else\n+#endif\n+\n+#if SLOTDURATION==15\n// time-slot related\n#define PORT_TsSlotDuration 492 // counter counts one extra count, see datasheet\n// execution speed related\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
Radio RX, TX now working.
802.15.4 timings in board_info.h still need to be measured and adjusted.
|
491,605 |
03.07.2018 13:18:53
| -7,200 |
1dd7191de3ea75fc941c1cc06e05729c968e883e
|
Removed unnecessary (and unsafe) call to callback function.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/nrf52840dk/radio.c",
"new_path": "bsp/boards/nrf52840dk/radio.c",
"diff": "@@ -56,7 +56,7 @@ typedef struct\nbool event_end;\n} radio_vars_t;\n-radio_vars_t radio_vars= {0};\n+static radio_vars_t radio_vars; // = {0};\n//=========================== prototypes ======================================\n@@ -231,11 +231,21 @@ void radio_rfOff(void)\nvoid radio_loadPacket(uint8_t* packet, uint16_t len)\n{\n+#if 0\n+ if ((uint32_t) radio_vars.payload % 4)\n+ {\n+ leds_debug_toggle();\n+ }\n+#endif\n+\nif ((len > 0) && (len <= MAX_PACKET_SIZE)) ///< note: 1st byte should be the payload size (for Nordic), and the two last bytes are used by the MAC layer for CRC\n{\nradio_vars.payload[0]= len;\nmemcpy(&radio_vars.payload[1], packet, len);\n}\n+\n+ // (re)set payload pointer\n+ NRF_RADIO->PACKETPTR = (uint32_t) &radio_vars.payload[0];\n}\n@@ -264,7 +274,12 @@ void radio_txNow(void)\n{\nif (radio_vars.transciever_state != TS_TX) { return; }\n+#if 0\n+ if (radio_vars.startFrame_cb)\n+ {\nradio_vars.startFrame_cb(sctimer_readCounter());\n+ }\n+#endif\nradio_vars.event_end= false;\nNRF_RADIO->EVENTS_END = 0U;\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
Removed unnecessary (and unsafe) call to callback function.
|
491,605 |
04.07.2018 13:58:53
| -7,200 |
ae623a2b864d645d652486d558d6a3ebe07bf6bd
|
Refined and tuned implementation to work with oos_openwsn project.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/nrf52840dk/debugpins.c",
"new_path": "bsp/boards/nrf52840dk/debugpins.c",
"diff": "// board debug PINS defines (Note that all of them are from port 0, i.e., 0.26, 0.27, etc. This is assumed in the below functions.)\n#define GPIO_DEBUGPIN_FRAME 26\n#define GPIO_DEBUGPIN_SLOT 27\n-#define GPIO_DEBUGPIN_FSM 28\n-#define GPIO_DEBUGPIN_TASK 29\n+#define GPIO_DEBUGPIN_FSM 29 // 28\n+#define GPIO_DEBUGPIN_TASK 28 // 29\n#define GPIO_DEBUGPIN_ISR 30\n#define GPIO_DEBUGPIN_RADIO 31\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/nrf52840dk/sctimer.c",
"new_path": "bsp/boards/nrf52840dk/sctimer.c",
"diff": "// ========================== define ==========================================\n-#define MINIMUM_COMPAREVALE_ADVANCE 2 // 5\n-#define COMPAREVALE_ADVANCE_STEP 1 // 2\n+#define MINIMUM_COMPAREVALE_ADVANCE 5 // 5 (2)\n+#define COMPAREVALE_ADVANCE_STEP 2 // 2 (1)\n#define MAX_RTC_TASKS_DELAY 47 // maximum delay in us until an RTC config task is executed\n#define CC_TIMER 0 // CC channel used for the timer's compare value\n@@ -39,7 +39,7 @@ typedef struct\nsctimer_vars_t sctimer_vars= {0};\n-static nrfx_rtc_t m_timer= NRFX_RTC_INSTANCE(0);\n+static nrfx_rtc_t m_timer= NRFX_RTC_INSTANCE(0); // we use RTC0\n@@ -96,11 +96,12 @@ void sctimer_set_callback(sctimer_cbt cb)\n*/\nvoid sctimer_setCompare(PORT_TIMER_WIDTH val)\n{\n+#define STOP_ON_RTC_ERROR 0\n+\nnrfx_err_t retVal= NRFX_SUCCESS;\n// make sure that no other CC match event will interrupt this block\nuint32_t int_mask= RTC_CHANNEL_INT_MASK(CC_TIMER);\n- nrf_rtc_event_t event= RTC_CHANNEL_EVENT_ADDR(CC_TIMER);\nnrf_rtc_event_disable(m_timer.p_reg, int_mask);\nnrf_rtc_int_disable(m_timer.p_reg, int_mask);\n@@ -108,7 +109,7 @@ void sctimer_setCompare(PORT_TIMER_WIDTH val)\nuint32_t counter_distance, counter_demanded;\nuint8_t restart_count= 0;\n- uint8_t const max_restart_count= 3;\n+ uint8_t const max_restart_count= 10;\nrestart:\n@@ -145,8 +146,8 @@ restart:\nretVal= nrfx_rtc_cc_set(&m_timer, CC_TIMER, counter_demanded & 0x00FFFFFF, false);\n// nrf_delay_us(MAX_RTC_TASKS_DELAY);\n- // nrfx_rtc_cc_set() will return NRFX_ERROR_TIMEOUT if the demanded CC value cannot be safely made by the timer.\n- // In that case, we reschedule the next event.\n+ // if in the init() we defined reliable==1, then nrfx_rtc_cc_set() will return NRFX_ERROR_TIMEOUT if the\n+ // demanded CC value cannot be safely made by the timer. In that case, we reschedule the next event.\nif ((NRFX_ERROR_TIMEOUT == retVal) && (restart_count < max_restart_count))\n{\nval += COMPAREVALE_ADVANCE_STEP;\n@@ -155,15 +156,16 @@ restart:\n}\n// re-enable CC event and interrupt\n- nrf_rtc_event_clear(m_timer.p_reg,event);\nnrf_rtc_int_enable(m_timer.p_reg, int_mask);\nnrf_rtc_event_enable(m_timer.p_reg,int_mask);\n+#if (STOP_ON_RTC_ERROR == 1)\nif (retVal != NRFX_SUCCESS)\n{\nleds_error_blink();\nboard_reset();\n}\n+#endif // (STOP_ON_RTC_ERROR != 0)\n}\n/**\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
Refined and tuned implementation to work with oos_openwsn project.
|
491,605 |
04.07.2018 13:59:50
| -7,200 |
a033099e1857c3c31a43525a50204a40c45c5732
|
Added empty implementation file of cryptoengine so that apps can be compiled, too.
Implementation neeeds to be added later for encrypted communication.
|
[
{
"change_type": "ADD",
"old_path": null,
"new_path": "bsp/boards/nrf52840dk/cryptoengine.c",
"diff": "+/**\n+\\brief Dummy implementation of cryptoengine.\n+*/\n+\n+#include <stdint.h>\n+#include <string.h>\n+#include \"cryptoengine.h\"\n+\n+owerror_t cryptoengine_aes_ccms_enc(uint8_t* a,\n+ uint8_t len_a,\n+ uint8_t* m,\n+ uint8_t* len_m,\n+ uint8_t* nonce,\n+ uint8_t l,\n+ uint8_t key[16],\n+ uint8_t len_mac) {\n+\n+ return E_FAIL;\n+}\n+\n+owerror_t cryptoengine_aes_ccms_dec(uint8_t* a,\n+ uint8_t len_a,\n+ uint8_t* m,\n+ uint8_t* len_m,\n+ uint8_t* nonce,\n+ uint8_t l,\n+ uint8_t key[16],\n+ uint8_t len_mac) {\n+\n+ return E_FAIL;\n+}\n+\n+owerror_t cryptoengine_aes_ecb_enc(uint8_t* buffer, uint8_t* key) {\n+ return E_FAIL;\n+}\n+\n+owerror_t cryptoengine_init(void) {\n+ return E_SUCCESS;\n+}\n+\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
Added empty implementation file of cryptoengine so that apps can be compiled, too.
Implementation neeeds to be added later for encrypted communication.
|
491,605 |
04.07.2018 14:36:24
| -7,200 |
800554b853c9d09e0917e0b62f39ff82aae81cf6
|
Hardware handshake (RTS/CTS) setting now used properly.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/nrf52840dk/uart.c",
"new_path": "bsp/boards/nrf52840dk/uart.c",
"diff": "@@ -60,7 +60,7 @@ void uart_init(void)\n.cts_pin_no= CTS_PIN_NUMBER, // defaults to UART_PIN_DISCONNECTED\n.baud_rate= UART_DEFAULT_CONFIG_BAUDRATE,\n.use_parity= (UART_DEFAULT_CONFIG_PARITY != 0) ? (true) : (false),\n- .flow_control= HWFC // defaults to false\n+ .flow_control= UART_DEFAULT_CONFIG_HWFC // defaults to false\n};\n// if UART cannot be initialized, blink error LED for 10s, and then reset\n@@ -113,7 +113,7 @@ uint8_t uart_readByte(void)\nvoid uart_event_handler(app_uart_evt_t * p_event)\n{\n- debugpins_isr_set();\n+// debugpins_isr_set();\nif ((p_event->evt_type == APP_UART_COMMUNICATION_ERROR) || (p_event->evt_type == APP_UART_FIFO_ERROR) || (p_event->evt_type == APP_UART_FIFO_ERROR))\n{\n@@ -131,7 +131,7 @@ void uart_event_handler(app_uart_evt_t * p_event)\nuart_tx_isr();\n}\n- debugpins_isr_clr();\n+// debugpins_isr_clr();\n}\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
Hardware handshake (RTS/CTS) setting now used properly.
|
491,609 |
27.06.2018 12:12:50
| -7,200 |
cba22cd6416033c1df5a5aebc9b8573886c80202
|
Add content format to join requests.
|
[
{
"change_type": "MODIFY",
"old_path": "openapps/cjoin/cjoin.c",
"new_path": "openapps/cjoin/cjoin.c",
"diff": "@@ -267,10 +267,16 @@ owerror_t cjoin_sendJoinRequest(open_addr_t* joinProxy) {\n// length and value are set by the CoAP library\n// options[2].type = COAP_OPTION_NUM_OBJECTSECURITY;\n+ // FIXME content format is needed for testing with F-Interop\n+ cjoin_vars.medType = COAP_MEDTYPE_APPCBOR;\n+ options[2].type = COAP_OPTION_NUM_CONTENTFORMAT;\n+ options[2].length = 1;\n+ options[2].pValue = &cjoin_vars.medType;\n+\n// ProxyScheme set to \"coap\"\n- options[2].type = COAP_OPTION_NUM_PROXYSCHEME;\n- options[2].length = sizeof(proxyScheme)-1;\n- options[2].pValue = (uint8_t *)proxyScheme;\n+ options[3].type = COAP_OPTION_NUM_PROXYSCHEME;\n+ options[3].length = sizeof(proxyScheme)-1;\n+ options[3].pValue = (uint8_t *)proxyScheme;\n// metadata\npkt->l4_destination_port = WKP_UDP_COAP;\n@@ -294,7 +300,7 @@ owerror_t cjoin_sendJoinRequest(open_addr_t* joinProxy) {\nCOAP_CODE_REQ_POST,\n0, // token len\noptions,\n- 3, // options len\n+ 4, // options len\n&cjoin_vars.desc\n);\n"
},
{
"change_type": "MODIFY",
"old_path": "openapps/cjoin/cjoin.h",
"new_path": "openapps/cjoin/cjoin.h",
"diff": "@@ -19,6 +19,7 @@ typedef struct {\nopentimers_id_t timerId;\nbool isJoined;\noscoap_security_context_t context;\n+ uint8_t medType;\n} cjoin_vars_t;\n//=========================== variables =======================================\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-755. Add content format to join requests.
|
491,605 |
05.07.2018 13:15:05
| -7,200 |
9b6e78d93e66443d341ec63f5bed46bc04fd2557
|
debugpins and radio LED enabled in code, again
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/nrf52840dk/radio.c",
"new_path": "bsp/boards/nrf52840dk/radio.c",
"diff": "@@ -226,6 +226,10 @@ void radio_rfOff(void)\n#endif // WAIT_FOR_RADIO_DISABLE == 1\nradio_vars.transciever_state = TS_OFF;\n+\n+ // ease debugging\n+ debugpins_radio_clr();\n+ leds_radio_off();\n}\n@@ -267,6 +271,10 @@ void radio_txEnable(void)\n#endif // WAIT_FOR_RADIO_ENABLE == 1\nradio_vars.transciever_state = TS_TX;\n+\n+ // ease debugging\n+ debugpins_radio_set();\n+ leds_radio_on();\n}\n@@ -314,6 +322,10 @@ void radio_rxEnable(void)\n#endif // WAIT_FOR_RADIO_ENABLE == 1\nradio_vars.transciever_state = TS_RX;\n+\n+ // ease debugging\n+ debugpins_radio_set();\n+ leds_radio_on();\n}\n@@ -394,6 +406,8 @@ kick_scheduler_t radio_isr(void)\nvoid RADIO_IRQHandler(void)\n{\n+ debugpins_isr_set();\n+\nif (NRF_RADIO->EVENTS_READY && (NRF_RADIO->INTENSET & RADIO_INTENSET_READY_Msk))\n{\nNRF_RADIO->EVENTS_READY = 0;\n@@ -421,4 +435,6 @@ void RADIO_IRQHandler(void)\nradio_vars.endFrame_cb(sctimer_readCounter());\n}\n}\n+\n+ debugpins_isr_clr();\n}\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
debugpins and radio LED enabled in code, again
|
491,595 |
06.07.2018 19:23:25
| -7,200 |
7fa77005b819a5f4837b9e5eba656c2c47b72b81
|
Update IAR projects for TelosB.
|
[
{
"change_type": "MODIFY",
"old_path": "openapps/cjoin/cojp_cbor.h",
"new_path": "openapps/cjoin/cojp_cbor.h",
"diff": "@@ -92,7 +92,7 @@ typedef struct {\ntypedef struct {\ncojp_role_values_t role;\n- open_addr_t * pan_id;;\n+ open_addr_t * pan_id;\n} cojp_join_request_object_t;\n//=========================== variables =======================================\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/common/02drv_openserial/02drv_openserial.c",
"new_path": "projects/common/02drv_openserial/02drv_openserial.c",
"diff": "@@ -95,30 +95,41 @@ void ieee154e_getAsn(uint8_t* array) {\narray[4] = 0x04;\n}\n-void idmanager_setJoinKey(void) {}\n+void idmanager_setJoinKey(uint8_t *key) {}\nvoid idmanager_triggerAboutRoot(void) {}\nvoid openbridge_triggerData(void) {}\nvoid tcpinject_trigger(void) {}\nvoid udpinject_trigger(void) {}\nvoid icmpv6echo_trigger(void) {}\n-void icmpv6rpl_setDIOPeriod(void){}\n-void icmpv6rpl_setDAOPeriod(void){}\n+void icmpv6rpl_setDIOPeriod(uint16_t dioPeriod){};\n+void icmpv6rpl_setDAOPeriod(uint16_t daoPeriod){};\nvoid icmpv6echo_setIsReplyEnabled(bool isEnabled){}\n-void sixtop_setEBPeriod(void){}\n-void sixtop_setKaPeriod(void){}\n+void sixtop_setEBPeriod(uint8_t ebPeriod){}\n+void sixtop_setKaPeriod(uint16_t kaPeriod){}\nvoid sixtop_setHandler(void){}\n-void sixtop_request(void){}\n+owerror_t sixtop_request(\n+ uint8_t code,\n+ open_addr_t* neighbor,\n+ uint8_t numCells,\n+ uint8_t cellOptions,\n+ cellInfo_ht* celllist_toBeAdded,\n+ cellInfo_ht* celllist_toBeDeleted,\n+ uint8_t sfid,\n+ uint16_t listingOffset,\n+ uint16_t listingMaxNumCells\n+){return 0;}\nvoid sixtop_addORremoveCellByInfo(void){}\n-void sixtop_setIsResponseEnabled(void){}\n-void icmpv6rpl_setMyDAGrank(void){}\n-void icmpv6rpl_getPreferredParentEui64(void){}\n-void schedule_setFrameLength(void){}\n-void ieee154e_setSlotDuration(void){}\n-void ieee154e_setIsSecurityEnabled(void){}\n-void ieee154e_setIsAckEnabled(void){}\n-void ieee154e_setSingleChannel(void){}\n-void sniffer_setListeningChannel(void){}\n-void msf_appPktPeriod(void){}\n+void sixtop_setIsResponseEnabled(bool isEnabled){}\n+void icmpv6rpl_setMyDAGrank(dagrank_t rank){}\n+bool icmpv6rpl_getPreferredParentIndex(uint8_t* indexptr){return TRUE;}\n+bool icmpv6rpl_getPreferredParentEui64(open_addr_t* addressToWrite){return TRUE;}\n+void schedule_setFrameLength(uint16_t newFrameLength){}\n+void ieee154e_setSlotDuration(uint16_t duration){}\n+void ieee154e_setIsSecurityEnabled(bool isEnabled){}\n+void ieee154e_setIsAckEnabled(bool isEnabled){}\n+void ieee154e_setSingleChannel(uint8_t channel){}\n+void sniffer_setListeningChannel(uint8_t channel){}\n+void msf_appPktPeriod(uint8_t numAppPacketsPerSlotFrame){}\nuint8_t msf_getsfid(void) {return 0;}\nbool debugPrint_isSync(void) {\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/openmote-cc2538/03oos_openwsn/03oos_openwsn.ewp",
"new_path": "projects/openmote-cc2538/03oos_openwsn/03oos_openwsn.ewp",
"diff": "<debug>1</debug>\n<option>\n<name>CCDefines</name>\n- <state></state>\n+ <state>L2_SECURITY_ACTIVE</state>\n</option>\n<option>\n<name>CCPreprocFile</name>\n<group>\n<name>cjoin</name>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\openapps\\cjoin\\cbor.c</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\openapps\\cjoin\\cjoin.c</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\openapps\\cjoin\\cbor.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\openapps\\cjoin\\cjoin.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\openapps\\cjoin\\cjoin.c</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\openapps\\cjoin\\cojp_cbor.c</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\openapps\\cjoin\\cjoin.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\openapps\\cjoin\\cojp_cbor.h</name>\n</file>\n</group>\n<group>\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/telosb/01bsp_debugpins/01bsp_debugpins.ewp",
"new_path": "projects/telosb/01bsp_debugpins/01bsp_debugpins.ewp",
"diff": "</configuration>\n<group>\n<name>bsp</name>\n- <excluded>\n- <configuration>Debug</configuration>\n- </excluded>\n<group>\n<name>boards</name>\n<group>\n<name>$PROJ_DIR$\\..\\..\\..\\inc\\opendefs.h</name>\n</file>\n</group>\n- <group>\n- <name>libs</name>\n- <file>\n- <name>$PROJ_DIR$\\..\\lib_bsp\\Debug\\Exe\\lib_bsp.r43</name>\n- </file>\n- </group>\n<group>\n<name>projects</name>\n<group>\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/telosb/01bsp_uart/01bsp_uart.ewp",
"new_path": "projects/telosb/01bsp_uart/01bsp_uart.ewp",
"diff": "<name>bsp</name>\n<group>\n<name>boards</name>\n- <group>\n- <name>common</name>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\abstimer.c</name>\n- <excluded>\n- <configuration>Debug</configuration>\n- </excluded>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\abstimers2.c</name>\n- <excluded>\n- <configuration>Debug</configuration>\n- </excluded>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\aes_cbc.c</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\aes_cbc.h</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\aes_ccms.c</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\aes_ccms.h</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\aes_ctr.c</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\aes_ctr.h</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\aes_ecb.c</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\aes_ecb.h</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\dummy_crypto_engine.c</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\dummy_crypto_engine.h</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\firmware_crypto_engine.c</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\firmware_crypto_engine.h</name>\n- </file>\n- </group>\n<group>\n<name>telosb</name>\n<file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\telosb\\board.c</name>\n</file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\telosb\\board_crypto_engine.c</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\telosb\\board_crypto_engine.h</name>\n- </file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\telosb\\board_info.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\telosb\\bsp_timer.c</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\telosb\\cryptoengine.c</name>\n</file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\telosb\\debugpins.c</name>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\telosb\\leds.c</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\telosb\\radiotimer.c</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\telosb\\sctimer.c</name>\n</file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\telosb\\sensors.c</name>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\cc2420\\cc2420.h</name>\n</file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\cc2420\\cc2420_crypto.c</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\cc2420\\cc2420_crypto.h</name>\n- </file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\cc2420\\radio.c</name>\n</file>\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/telosb/02drv_openserial/02drv_openserial.ewp",
"new_path": "projects/telosb/02drv_openserial/02drv_openserial.ewp",
"diff": "<name>bsp</name>\n<group>\n<name>boards</name>\n- <group>\n- <name>common</name>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\abstimer.c</name>\n- <excluded>\n- <configuration>Debug</configuration>\n- </excluded>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\abstimers2.c</name>\n- <excluded>\n- <configuration>Debug</configuration>\n- </excluded>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\aes_cbc.c</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\aes_cbc.h</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\aes_ccms.c</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\aes_ccms.h</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\aes_ctr.c</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\aes_ctr.h</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\aes_ecb.c</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\aes_ecb.h</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\dummy_crypto_engine.c</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\dummy_crypto_engine.h</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\firmware_crypto_engine.c</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\firmware_crypto_engine.h</name>\n- </file>\n- </group>\n<group>\n<name>telosb</name>\n<file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\telosb\\board.c</name>\n</file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\telosb\\board_crypto_engine.c</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\telosb\\board_crypto_engine.h</name>\n- </file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\telosb\\board_info.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\telosb\\bsp_timer.c</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\telosb\\cryptoengine.c</name>\n</file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\telosb\\debugpins.c</name>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\telosb\\leds.c</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\telosb\\radiotimer.c</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\telosb\\sctimer.c</name>\n</file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\telosb\\sensors.c</name>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\cc2420\\cc2420.h</name>\n</file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\cc2420\\cc2420_crypto.c</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\cc2420\\cc2420_crypto.h</name>\n- </file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\cc2420\\radio.c</name>\n</file>\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/telosb/02drv_opentimers/02drv_opentimers.ewp",
"new_path": "projects/telosb/02drv_opentimers/02drv_opentimers.ewp",
"diff": "<name>bsp</name>\n<group>\n<name>boards</name>\n- <group>\n- <name>common</name>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\abstimer.c</name>\n- <excluded>\n- <configuration>Debug</configuration>\n- </excluded>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\abstimers2.c</name>\n- <excluded>\n- <configuration>Debug</configuration>\n- </excluded>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\aes_cbc.c</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\aes_cbc.h</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\aes_ccms.c</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\aes_ccms.h</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\aes_ctr.c</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\aes_ctr.h</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\aes_ecb.c</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\aes_ecb.h</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\dummy_crypto_engine.c</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\dummy_crypto_engine.h</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\firmware_crypto_engine.c</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\firmware_crypto_engine.h</name>\n- </file>\n- </group>\n<group>\n<name>telosb</name>\n<file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\telosb\\board.c</name>\n</file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\telosb\\board_crypto_engine.c</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\telosb\\board_crypto_engine.h</name>\n- </file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\telosb\\board_info.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\telosb\\bsp_timer.c</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\telosb\\cryptoengine.c</name>\n</file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\telosb\\debugpins.c</name>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\telosb\\leds.c</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\telosb\\radiotimer.c</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\telosb\\sctimer.c</name>\n</file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\telosb\\sensors.c</name>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\cc2420\\cc2420.h</name>\n</file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\cc2420\\cc2420_crypto.c</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\cc2420\\cc2420_crypto.h</name>\n- </file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\cc2420\\radio.c</name>\n</file>\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/telosb/03oos_macpong/03oos_macpong.ewp",
"new_path": "projects/telosb/03oos_macpong/03oos_macpong.ewp",
"diff": "<name>bsp</name>\n<group>\n<name>boards</name>\n- <group>\n- <name>common</name>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\abstimer.c</name>\n- <excluded>\n- <configuration>Debug</configuration>\n- </excluded>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\abstimers2.c</name>\n- <excluded>\n- <configuration>Debug</configuration>\n- </excluded>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\aes_cbc.c</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\aes_cbc.h</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\aes_ccms.c</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\aes_ccms.h</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\aes_ctr.c</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\aes_ctr.h</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\aes_ecb.c</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\aes_ecb.h</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\dummy_crypto_engine.c</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\dummy_crypto_engine.h</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\firmware_crypto_engine.c</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\firmware_crypto_engine.h</name>\n- </file>\n- </group>\n<group>\n<name>telosb</name>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\telosb\\board.c</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\telosb\\board_crypto_engine.c</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\telosb\\board_crypto_engine.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\telosb\\board_info.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\telosb\\board_info.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\telosb\\cryptoengine.c</name>\n</file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\telosb\\debugpins.c</name>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\cc2420\\cc2420.h</name>\n</file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\cc2420\\cc2420_crypto.c</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\cc2420\\cc2420_crypto.h</name>\n- </file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\cc2420\\radio.c</name>\n</file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\openstack\\02a-MAClow\\IEEE802154.h</name>\n</file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\openstack\\02a-MAClow\\IEEE802154_dummy_security.c</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\openstack\\02a-MAClow\\IEEE802154_dummy_security.h</name>\n- </file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\openstack\\02a-MAClow\\IEEE802154_security.c</name>\n</file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\openstack\\02a-MAClow\\IEEE802154_security.h</name>\n</file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\openstack\\02a-MAClow\\ieee802154_security_driver.h</name>\n- </file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\openstack\\02a-MAClow\\IEEE802154E.c</name>\n</file>\n<group>\n<name>02b-MAChigh</name>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\openstack\\02b-MAChigh\\neighbors.c</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\openstack\\02b-MAChigh\\msf.c</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\openstack\\02b-MAChigh\\neighbors.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\openstack\\02b-MAChigh\\msf.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\openstack\\02b-MAChigh\\processIE.c</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\openstack\\02b-MAChigh\\neighbors.c</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\openstack\\02b-MAChigh\\processIE.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\openstack\\02b-MAChigh\\neighbors.h</name>\n</file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\openstack\\02b-MAChigh\\schedule.c</name>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\openstack\\02b-MAChigh\\schedule.h</name>\n</file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\openstack\\02b-MAChigh\\msf.c</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\openstack\\02b-MAChigh\\msf.h</name>\n- </file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\openstack\\02b-MAChigh\\sixtop.c</name>\n</file>\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/telosb/03oos_mercator/03oos_mercator.ewp",
"new_path": "projects/telosb/03oos_mercator/03oos_mercator.ewp",
"diff": "<state>$PROJ_DIR$\\..\\..\\..\\openapps\\</state>\n<state>$PROJ_DIR$\\..\\..\\..\\openapps\\c6t\\</state>\n<state>$PROJ_DIR$\\..\\..\\..\\openapps\\cexample\\</state>\n+ <state>$PROJ_DIR$\\..\\..\\..\\openapps\\cjoin\\</state>\n<state>$PROJ_DIR$\\..\\..\\..\\openapps\\cinfo\\</state>\n<state>$PROJ_DIR$\\..\\..\\..\\openapps\\cleds\\</state>\n<state>$PROJ_DIR$\\..\\..\\..\\openapps\\csensors\\</state>\n<state>$PROJ_DIR$\\..\\..\\..\\openapps\\cstorm\\</state>\n<state>$PROJ_DIR$\\..\\..\\..\\openapps\\cwellknown\\</state>\n+ <state>$PROJ_DIR$\\..\\..\\..\\openapps\\opencoap\\</state>\n<state>$PROJ_DIR$\\..\\..\\..\\openapps\\rrt\\</state>\n<state>$PROJ_DIR$\\..\\..\\..\\openapps\\techo\\</state>\n<state>$PROJ_DIR$\\..\\..\\..\\openapps\\tohlone\\</state>\n<state>$PROJ_DIR$\\..\\..\\..\\openapps\\uecho\\</state>\n<state>$PROJ_DIR$\\..\\..\\..\\openapps\\uinject\\</state>\n<state>$PROJ_DIR$\\..\\..\\..\\openapps\\userialbridge\\</state>\n+ <state>$PROJ_DIR$\\..\\..\\..\\openapps\\uexpiration\\</state>\n+ <state>$PROJ_DIR$\\..\\..\\..\\openapps\\uexpiration_monitor\\</state>\n<state>$PROJ_DIR$\\..\\..\\..\\openstack\\</state>\n<state>$PROJ_DIR$\\..\\..\\..\\openstack\\02a-MAClow\\</state>\n<state>$PROJ_DIR$\\..\\..\\..\\openstack\\02b-MAChigh\\</state>\n<name>bsp</name>\n<group>\n<name>boards</name>\n- <group>\n- <name>common</name>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\abstimer.c</name>\n- <excluded>\n- <configuration>Debug</configuration>\n- </excluded>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\abstimers2.c</name>\n- <excluded>\n- <configuration>Debug</configuration>\n- </excluded>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\aes_cbc.c</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\aes_cbc.h</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\aes_ccms.c</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\aes_ccms.h</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\aes_ctr.c</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\aes_ctr.h</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\aes_ecb.c</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\aes_ecb.h</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\dummy_crypto_engine.c</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\dummy_crypto_engine.h</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\firmware_crypto_engine.c</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\firmware_crypto_engine.h</name>\n- </file>\n- </group>\n<group>\n<name>telosb</name>\n<file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\telosb\\board.c</name>\n</file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\telosb\\board_crypto_engine.c</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\telosb\\board_crypto_engine.h</name>\n- </file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\telosb\\board_info.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\telosb\\bsp_timer.c</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\telosb\\cryptoengine.c</name>\n</file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\telosb\\debugpins.c</name>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\telosb\\leds.c</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\telosb\\radiotimer.c</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\telosb\\sctimer.c</name>\n</file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\telosb\\sensors.c</name>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\cc2420\\cc2420.h</name>\n</file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\cc2420\\cc2420_crypto.c</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\cc2420\\cc2420_crypto.h</name>\n- </file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\cc2420\\radio.c</name>\n</file>\n<name>$PROJ_DIR$\\..\\..\\..\\openapps\\cinfo\\cinfo.h</name>\n</file>\n</group>\n+ <group>\n+ <name>cjoin</name>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\openapps\\cjoin\\cjoin.c</name>\n+ </file>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\openapps\\cjoin\\cjoin.h</name>\n+ </file>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\openapps\\cjoin\\cojp_cbor.c</name>\n+ </file>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\openapps\\cjoin\\cojp_cbor.h</name>\n+ </file>\n+ </group>\n<group>\n<name>cleds</name>\n<file>\n</file>\n</group>\n<group>\n- <name>rrt</name>\n+ <name>opencoap</name>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\openapps\\rrt\\rrt.c</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\openapps\\opencoap\\cborencoder.c</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\openapps\\rrt\\rrt.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\openapps\\opencoap\\cborencoder.h</name>\n</file>\n- </group>\n- <group>\n- <name>techo</name>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\openapps\\techo\\techo.c</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\openapps\\opencoap\\hkdf.c</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\openapps\\techo\\techo.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\openapps\\opencoap\\hmac.c</name>\n</file>\n- </group>\n- <group>\n- <name>tohlone</name>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\openapps\\tohlone\\tohlone.c</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\openapps\\opencoap\\opencoap.c</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\openapps\\tohlone\\tohlone.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\openapps\\opencoap\\opencoap.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\openapps\\tohlone\\tohlone_webpages.c</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\openapps\\opencoap\\openoscoap.c</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\openapps\\tohlone\\tohlone_webpages.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\openapps\\opencoap\\openoscoap.h</name>\n+ </file>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\openapps\\opencoap\\sha-private.h</name>\n+ </file>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\openapps\\opencoap\\sha.h</name>\n+ </file>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\openapps\\opencoap\\sha224-256.c</name>\n+ </file>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\openapps\\opencoap\\usha.c</name>\n+ </file>\n+ </group>\n+ <group>\n+ <name>rrt</name>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\openapps\\rrt\\rrt.c</name>\n+ </file>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\openapps\\rrt\\rrt.h</name>\n</file>\n</group>\n<group>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\openstack\\02a-MAClow\\IEEE802154.h</name>\n</file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\openstack\\02a-MAClow\\IEEE802154_dummy_security.c</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\openstack\\02a-MAClow\\IEEE802154_dummy_security.h</name>\n- </file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\openstack\\02a-MAClow\\IEEE802154_security.c</name>\n</file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\openstack\\02a-MAClow\\IEEE802154_security.h</name>\n</file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\openstack\\02a-MAClow\\ieee802154_security_driver.h</name>\n- </file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\openstack\\02a-MAClow\\IEEE802154E.c</name>\n</file>\n<group>\n<name>02b-MAChigh</name>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\openstack\\02b-MAChigh\\neighbors.c</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\openstack\\02b-MAChigh\\msf.c</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\openstack\\02b-MAChigh\\neighbors.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\openstack\\02b-MAChigh\\msf.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\openstack\\02b-MAChigh\\processIE.c</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\openstack\\02b-MAChigh\\neighbors.c</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\openstack\\02b-MAChigh\\processIE.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\openstack\\02b-MAChigh\\neighbors.h</name>\n</file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\openstack\\02b-MAChigh\\schedule.c</name>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\openstack\\02b-MAChigh\\schedule.h</name>\n</file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\openstack\\02b-MAChigh\\msf.c</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\openstack\\02b-MAChigh\\msf.h</name>\n- </file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\openstack\\02b-MAChigh\\sixtop.c</name>\n</file>\n</group>\n<group>\n<name>04-TRAN</name>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\openstack\\04-TRAN\\opencoap.c</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\openstack\\04-TRAN\\opencoap.h</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\openstack\\04-TRAN\\opentcp.c</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\openstack\\04-TRAN\\opentcp.h</name>\n- </file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\openstack\\04-TRAN\\openudp.c</name>\n</file>\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/telosb/03oos_openwsn/03oos_openwsn.ewp",
"new_path": "projects/telosb/03oos_openwsn/03oos_openwsn.ewp",
"diff": "<state>$PROJ_DIR$\\..\\..\\..\\openapps\\</state>\n<state>$PROJ_DIR$\\..\\..\\..\\openapps\\c6t\\</state>\n<state>$PROJ_DIR$\\..\\..\\..\\openapps\\cexample\\</state>\n+ <state>$PROJ_DIR$\\..\\..\\..\\openapps\\cjoin\\</state>\n<state>$PROJ_DIR$\\..\\..\\..\\openapps\\cinfo\\</state>\n<state>$PROJ_DIR$\\..\\..\\..\\openapps\\cleds\\</state>\n<state>$PROJ_DIR$\\..\\..\\..\\openapps\\csensors\\</state>\n<name>$PROJ_DIR$\\..\\..\\..\\openapps\\cinfo\\cinfo.h</name>\n</file>\n</group>\n+ <group>\n+ <name>cjoin</name>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\openapps\\cjoin\\cjoin.c</name>\n+ </file>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\openapps\\cjoin\\cjoin.h</name>\n+ </file>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\openapps\\cjoin\\cojp_cbor.c</name>\n+ </file>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\openapps\\cjoin\\cojp_cbor.h</name>\n+ </file>\n+ </group>\n<group>\n<name>cleds</name>\n<file>\n</group>\n<group>\n<name>opencoap</name>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\openapps\\opencoap\\cborencoder.c</name>\n+ </file>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\openapps\\opencoap\\cborencoder.h</name>\n+ </file>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\openapps\\opencoap\\hkdf.c</name>\n+ </file>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\openapps\\opencoap\\hmac.c</name>\n+ </file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\openapps\\opencoap\\opencoap.c</name>\n</file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\openapps\\opencoap\\opencoap.h</name>\n</file>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\openapps\\opencoap\\openoscoap.c</name>\n+ </file>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\openapps\\opencoap\\openoscoap.h</name>\n+ </file>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\openapps\\opencoap\\sha-private.h</name>\n+ </file>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\openapps\\opencoap\\sha.h</name>\n+ </file>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\openapps\\opencoap\\sha224-256.c</name>\n+ </file>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\openapps\\opencoap\\usha.c</name>\n+ </file>\n</group>\n<group>\n<name>rrt</name>\n<group>\n<name>02b-MAChigh</name>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\openstack\\02b-MAChigh\\neighbors.c</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\openstack\\02b-MAChigh\\msf.c</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\openstack\\02b-MAChigh\\neighbors.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\openstack\\02b-MAChigh\\msf.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\openstack\\02b-MAChigh\\schedule.c</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\openstack\\02b-MAChigh\\neighbors.c</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\openstack\\02b-MAChigh\\schedule.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\openstack\\02b-MAChigh\\neighbors.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\openstack\\02b-MAChigh\\msf.c</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\openstack\\02b-MAChigh\\schedule.c</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\openstack\\02b-MAChigh\\msf.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\openstack\\02b-MAChigh\\schedule.h</name>\n</file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\openstack\\02b-MAChigh\\sixtop.c</name>\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/telosb/telosb.eww",
"new_path": "projects/telosb/telosb.eww",
"diff": "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n<workspace>\n- <project>\n- <path>$WS_DIR$\\lib_bsp\\lib_bsp.ewp</path>\n- </project>\n<project>\n<path>$WS_DIR$\\00std_button\\00std_button.ewp</path>\n</project>\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-765. Update IAR projects for TelosB.
|
491,595 |
09.07.2018 09:29:26
| -7,200 |
021cded86cb9837cb751957c2daafeea40856b25
|
fix oos_openwsn project compiling error on IAR.
|
[
{
"change_type": "MODIFY",
"old_path": "projects/iot-lab_M3/03oos_openwsn/03oos_openwsn.ewp",
"new_path": "projects/iot-lab_M3/03oos_openwsn/03oos_openwsn.ewp",
"diff": "<name>$PROJ_DIR$\\..\\..\\..\\openapps\\cinfo\\cinfo.c</name>\n</file>\n</group>\n+ <group>\n+ <name>cjoin</name>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\openapps\\cjoin\\cjoin.c</name>\n+ </file>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\openapps\\cjoin\\cjoin.h</name>\n+ </file>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\openapps\\cjoin\\cojp_cbor.c</name>\n+ </file>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\openapps\\cjoin\\cojp_cbor.h</name>\n+ </file>\n+ </group>\n<group>\n<name>cleds</name>\n<file>\n<group>\n<name>02b-MAChigh</name>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\openstack\\02b-MAChigh\\neighbors.c</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\openstack\\02b-MAChigh\\msf.c</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\openstack\\02b-MAChigh\\schedule.c</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\openstack\\02b-MAChigh\\neighbors.c</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\openstack\\02b-MAChigh\\msf.c</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\openstack\\02b-MAChigh\\schedule.c</name>\n</file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\openstack\\02b-MAChigh\\sixtop.c</name>\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-765. fix oos_openwsn project compiling error on IAR.
|
491,592 |
09.07.2018 17:26:57
| -7,200 |
d43598a414a2b5c2e4837379efa603504f769fa3
|
fixing compilation error in this file
|
[
{
"change_type": "MODIFY",
"old_path": "projects/common/01bsp_radio_rx/01bsp_radio_rx.c",
"new_path": "projects/common/01bsp_radio_rx/01bsp_radio_rx.c",
"diff": "@@ -68,7 +68,7 @@ len=17 num=84 rssi=-81 lqi=108 crc=1\n#include \"radio.h\"\n#include \"leds.h\"\n#include \"uart.h\"\n-#include \"sctimer.h\"\n+//#include \"sctimer.h\"\n//=========================== defines =========================================\n@@ -128,8 +128,8 @@ int mote_main(void) {\nboard_init();\n// add callback functions radio\n- sctimer_setStartFrameCb(cb_startFrame);\n- sctimer_setEndFrameCb(cb_endFrame);\n+ radio_setStartFrameCb(cb_startFrame);\n+ radio_setEndFrameCb(cb_endFrame);\n// setup UART\nuart_setCallbacks(cb_uartTxDone,cb_uartRxCb);\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-766 fixing compilation error in this file
|
491,592 |
11.07.2018 16:54:03
| -7,200 |
66f1fb474fe9800214984eeb3bf44902d66316ac
|
fixing radio rx not turned on
|
[
{
"change_type": "MODIFY",
"old_path": "projects/common/01bsp_radio_rx/01bsp_radio_rx.c",
"new_path": "projects/common/01bsp_radio_rx/01bsp_radio_rx.c",
"diff": "@@ -73,7 +73,7 @@ len=17 num=84 rssi=-81 lqi=108 crc=1\n//=========================== defines =========================================\n#define LENGTH_PACKET 125+LENGTH_CRC ///< maximum length is 127 bytes\n-#define CHANNEL 11 ///< 11 = 2.405GHz\n+#define CHANNEL 16 ///< 11 = 2.405GHz\n#define LENGTH_SERIAL_FRAME 8 ///< length of the serial frame\n//=========================== variables =======================================\n@@ -140,14 +140,18 @@ int mote_main(void) {\n// switch in RX\nradio_rxEnable();\n+ radio_rxNow();\nwhile (1) {\n// sleep while waiting for at least one of the rxpk_done to be set\n+\n+\napp_vars.rxpk_done = 0;\nwhile (app_vars.rxpk_done==0) {\nboard_sleep();\n}\n+ leds_debug_off();\n// if I get here, I just received a packet\n@@ -187,9 +191,10 @@ int mote_main(void) {\n//===== radio\nvoid cb_startFrame(PORT_TIMER_WIDTH timestamp) {\n-\n+ leds_debug_on();\n// update debug stats\napp_dbg.num_startFrame++;\n+\n}\nvoid cb_endFrame(PORT_TIMER_WIDTH timestamp) {\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/common/01bsp_radio_tx/01bsp_radio_tx.c",
"new_path": "projects/common/01bsp_radio_tx/01bsp_radio_tx.c",
"diff": "@@ -22,7 +22,7 @@ remainder of the packet contains an incrementing bytes.\n//=========================== defines =========================================\n#define LENGTH_PACKET 125+LENGTH_CRC // maximum length is 127 bytes\n-#define CHANNEL 11 // 11 = 2.405GHz\n+#define CHANNEL 16 // 11 = 2.405GHz\n#define TIMER_PERIOD (32768>>1) // (32768>>1) = 500ms @ 32kHz\n//=========================== variables =======================================\n@@ -77,7 +77,7 @@ int mote_main(void) {\nradio_rfOff();\n// start periodic overflow\n- sctimer_setCompare(TIMER_PERIOD);\n+ sctimer_setCompare(sctimer_readCounter()+ TIMER_PERIOD);\nsctimer_enable();\nwhile(1) {\n@@ -87,7 +87,7 @@ int mote_main(void) {\nwhile (app_vars.txpk_txNow==0) {\nboard_sleep();\n}\n-\n+ radio_setFrequency(CHANNEL);\n// led\nleds_error_toggle();\n@@ -118,9 +118,11 @@ void cb_radioTimerOverflows(void) {\n// update debug vals\napp_dbg.num_radioTimerOverflows++;\n-\n// ready to send next packet\napp_vars.txpk_txNow = 1;\n+// schedule again\n+ sctimer_setCompare(sctimer_readCounter()+ TIMER_PERIOD);\n+\n}\nvoid cb_startFrame(PORT_TIMER_WIDTH timestamp) {\n@@ -130,6 +132,7 @@ void cb_startFrame(PORT_TIMER_WIDTH timestamp) {\n// led\nleds_sync_on();\n+\n}\nvoid cb_endFrame(PORT_TIMER_WIDTH timestamp) {\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-768 fixing radio rx not turned on
|
491,605 |
13.07.2018 13:31:59
| -7,200 |
e384065fe47cafb049e9de0bf25359ccc87b9ed0
|
Critical tuning of time constants. Network now stable.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/nrf52840dk/board_info.h",
"new_path": "bsp/boards/nrf52840dk/board_info.h",
"diff": "// time-slot related\n#define PORT_TsSlotDuration 328 // counter counts one extra count, see datasheet\n// execution speed related\n- #define PORT_maxTxDataPrepare 10 // 305us (measured 82us)\n- #define PORT_maxRxAckPrepare 10 // 305us (measured 83us)\n- #define PORT_maxRxDataPrepare 4 // 122us (measured 22us)\n- #define PORT_maxTxAckPrepare 10 // 122us (measured 94us)\n+ #define PORT_maxTxDataPrepare 23 // ~700us (measured 517us)\n+ #define PORT_maxRxAckPrepare 23 // ~700us (measured 506us)\n+ #define PORT_maxRxDataPrepare 23 // ~700us (measured 506us)\n+ #define PORT_maxTxAckPrepare 23 // ~700us (measured 517us)\n// radio speed related\n#ifdef L2_SECURITY_ACTIVE\n#define PORT_delayTx 14 // 366us (measured xxxus)\n// time-slot related\n#define PORT_TsSlotDuration 492 // counter counts one extra count, see datasheet\n// execution speed related\n- #define PORT_maxTxDataPrepare 66 // 2014us (measured 746us)\n- #define PORT_maxRxAckPrepare 10 // 305us (measured 83us)\n- #define PORT_maxRxDataPrepare 33 // 1007us (measured 84us)\n- #define PORT_maxTxAckPrepare 22 // 305us (measured 219us)\n+ #define PORT_maxTxDataPrepare 23 // ~700us (measured 517us)\n+ #define PORT_maxRxAckPrepare 23 // ~700us (measured 506us)\n+ #define PORT_maxRxDataPrepare 23 // ~700us (measured 506us)\n+ #define PORT_maxTxAckPrepare 23 // ~700us (measured 517us)\n// radio speed related\n#define PORT_delayTx 12 // 214us (measured 219us)\n#define PORT_delayRx 0 // 0us (can not measure)\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
Critical tuning of time constants. Network now stable.
|
491,605 |
18.07.2018 08:36:23
| -7,200 |
2b4c32e641a08b1fd5ca91e3c4b269dfadac4e19
|
There was a problem with special cases (timer too late, or next CC value too close) when they happened during a 24-bit wrap of the hardware RTC.
It is now fixed.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/nrf52840dk/sctimer.c",
"new_path": "bsp/boards/nrf52840dk/sctimer.c",
"diff": "* (2) Faculty of Electronics and Computing, Zagreb, Croatia\n* Date: May 2018\n*\n- * Note: We use RTC0 hardware with its CC0 register.\n+ * Note: We use RTC0 peripheral with its CC0 register.\n*/\n-#include \"nrfx_rtc_hack.h\" ///< the implementation is based on the hacked version of Nordic's Real-Time Counter (RTC) driver\n+#include \"nrfx_rtc_hack.h\" ///< the implementation is based on the hacked version of Nordic's Real-Time Counter (RTC) driver, which allows us to schedule an RTC0 interrupt with CC0 event, triggered \"by hand\"\n#include \"sdk/components/libraries/delay/nrf_delay.h\"\n#include \"sdk/components/boards/pca10056.h\"\n// ========================== define ==========================================\n-#define MINIMUM_COMPAREVALE_ADVANCE 10 ///< equal to TIMERTHRESHOLD of opentimers\n+#define MINIMUM_ISR_ADVANCE 3 ///< number of ticks to set CC ahead to make sure the RTC will fire (should this be equal to TIMERTHRESHOLD of opentimers?)\n#define TIMERLOOP_THRESHOLD 0x20000 ///< 3s, if sctimer_setCompare() is late by max that many ticks, we still issue the ISR\n#define MAX_RTC_TASKS_DELAY 47 ///< maximum delay in us until an RTC config task is executed\n@@ -52,6 +52,13 @@ static nrfx_rtc_t m_timer= NRFX_RTC_INSTANCE(0);\nstatic void timer_event_handler(nrfx_rtc_int_type_t int_type);\n+#if (ENABLE_SEGGER_SYSVIEW == 1)\n+#define SEGGER_PRINTF(f_, ...) SEGGER_SYSVIEW_PrintfHost((f_), __VA_ARGS__)\n+#else\n+#define SEGGER_PRINTF(f_, ...) do {} while(0)\n+#endif // (ENABLE_SEGGER_SYSVIEW == 1)\n+\n+\n// ========================== protocol =========================================\n@@ -101,35 +108,41 @@ void sctimer_set_callback(sctimer_cbt cb)\n*/\nvoid sctimer_setCompare(PORT_TIMER_WIDTH val)\n{\n- uint32_t counter_current;\n- uint32_t distance_straight, distance_wrapped;\n+ uint32_t counter_current= sctimer_readCounter();\n- counter_current= sctimer_readCounter();\n#if (ENABLE_SEGGER_SYSVIEW == 1)\nuint32_t cc_current= NRF_RTC0->CC[0];\n#endif\n+// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n+#if 0\n+ uint32_t distance_straight, distance_wrapped;\n+\nif (val >= counter_current)\n{\ndistance_straight= val - counter_current;\ndistance_wrapped= (0xFFFFFFFF-val+1) + counter_current;\n- if ( (distance_wrapped < TIMERLOOP_THRESHOLD) || ///< val is higher, but actually counter is ahead and already in the next wrap\n- (distance_straight < MINIMUM_COMPAREVALE_ADVANCE) ) ///< val is ahead, but the difference is not enough for the timer to make it in time\n+ if (distance_wrapped < TIMERLOOP_THRESHOLD) ///< val is higher, but actually counter is ahead and already in the next wrap\n{\n-#if (ENABLE_SEGGER_SYSVIEW == 1)\n- SEGGER_SYSVIEW_PrintfHost(\"setIntPending_RTC0_CC0()\");\n-#endif // (ENABLE_SEGGER_SYSVIEW == 1)\n+ SEGGER_PRINTF(\"Counter=%u, CC_old=%u, CC_new=%u [LATE; CC not set; ISR scheduled]\", counter_current, cc_current, val);\nsetIntPending_RTC0_CC0();\n}\n+ else if (distance_straight < MINIMUM_ISR_ADVANCE) ///< val is ahead, but the difference is not enough for the timer to make it in time\n+ {\n+ uint32_t oldVal= val;\n+ val= (counter_current + MINIMUM_ISR_ADVANCE) & 0xFFFFFFFF;\n+ sctimer_vars.cc32bit_MSB= val & 0xFF000000; ///< set MSB of CC\n+ nrfx_rtc_cc_set(&m_timer, 0, val & 0x00FFFFFF, true); ///< set 3 LSBs of CC\n+ SEGGER_PRINTF(\"Counter=%u, CC_old=%u, CC_new=%u [FIXED from %u]\", counter_current, cc_current, val, oldVal);\n+ }\n+\nelse ///< other cases are not problematic\n{\n-#if (ENABLE_SEGGER_SYSVIEW == 1)\n- SEGGER_SYSVIEW_PrintfHost(\"Counter=%u, CC_old=%u, CC_new=%u\", counter_current, cc_current, val);\n-#endif // (ENABLE_SEGGER_SYSVIEW == 1)\nsctimer_vars.cc32bit_MSB= val & 0xFF000000; ///< set MSB of CC\nnrfx_rtc_cc_set(&m_timer, 0, val & 0x00FFFFFF, true); ///< set 3 LSBs of CC\n+ // SEGGER_PRINTF(\"Counter=%u, CC_old=%u, CC_new=%u\", counter_current, cc_current, val);\n}\n}\n@@ -138,24 +151,60 @@ void sctimer_setCompare(PORT_TIMER_WIDTH val)\ndistance_straight= counter_current - val;\ndistance_wrapped= (0xFFFFFFFF-counter_current+1) + val;\n- if ( (distance_wrapped < MINIMUM_COMPAREVALE_ADVANCE) || ///< val is ahead, but the difference is not enough for the timer to make it in time\n- (distance_straight < TIMERLOOP_THRESHOLD) ) ///< val is lagging, but within TIMERLOOP limits\n+ if (distance_straight < TIMERLOOP_THRESHOLD) ///< val is lagging, but within TIMERLOOP limits\n{\n-#if (ENABLE_SEGGER_SYSVIEW == 1)\n- SEGGER_SYSVIEW_PrintfHost(\"setIntPending_RTC0_CC0()\");\n-#endif // (ENABLE_SEGGER_SYSVIEW == 1)\n+ SEGGER_PRINTF(\"Counter=%u, CC_old=%u, CC_new=%u [LATE; CC not set; ISR scheduled]\", counter_current, cc_current, val);\nsetIntPending_RTC0_CC0();\n}\n+ else if (distance_wrapped < MINIMUM_ISR_ADVANCE) ///< val is ahead, but the difference is not enough for the timer to make it in time\n+ {\n+ uint32_t oldVal= val;\n+ val= (counter_current + MINIMUM_ISR_ADVANCE) & 0xFFFFFFFF;\n+ sctimer_vars.cc32bit_MSB= val & 0xFF000000; ///< set MSB of CC\n+ nrfx_rtc_cc_set(&m_timer, 0, val & 0x00FFFFFF, true); ///< set 3 LSBs of CC\n+ SEGGER_PRINTF(\"Counter=%u, CC_old=%u, CC_new=%u [FIXED from %u]\", counter_current, cc_current, val, oldVal);\n+ }\n+\nelse ///< other cases are not problematic\n{\n-#if (ENABLE_SEGGER_SYSVIEW == 1)\n- SEGGER_SYSVIEW_PrintfHost(\"Counter=%u, CC_old=%u, CC_new=%u\", counter_current, cc_current, val);\n-#endif // (ENABLE_SEGGER_SYSVIEW == 1)\nsctimer_vars.cc32bit_MSB= val & 0xFF000000; ///< set MSB of CC\nnrfx_rtc_cc_set(&m_timer, 0, val & 0x00FFFFFF, true); ///< set 3 LSBs of CC\n+ // SEGGER_PRINTF(\"Counter=%u, CC_old=%u, CC_new=%u\", counter_current, cc_current, val);\n+ }\n+ }\n+#endif\n+// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n+\n+// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n+// #if 0\n+ if (counter_current - val < TIMERLOOP_THRESHOLD)\n+ {\n+ // the timer is already late, schedule the ISR right now manually\n+ sctimer_vars.cc32bit_MSB= val & 0xFF000000; ///< set MSB of CC\n+ setIntPending_RTC0_CC0();\n+ SEGGER_PRINTF(\"Counter=%u, CC_old=%u, CC_new=%u [LATE; CC not set; ISR scheduled]\", counter_current, cc_current, val);\n+ }\n+ else\n+ {\n+ if (val-counter_current<MINIMUM_ISR_ADVANCE)\n+ {\n+ // there is hardware limitation to schedule the timer within TIMERTHRESHOLD ticks schedule ISR right now manually\n+ sctimer_vars.cc32bit_MSB= val & 0xFF000000; ///< set MSB of CC\n+ setIntPending_RTC0_CC0();\n+ SEGGER_PRINTF(\"Counter=%u, CC_old=%u, CC_new=%u [HWLIM; CC not set; ISR scheduled]\", counter_current, cc_current, val);\n+ }\n+ else\n+ {\n+ // schedule the timer at val\n+ sctimer_vars.cc32bit_MSB= val & 0xFF000000; ///< set MSB of CC\n+ nrfx_rtc_cc_set(&m_timer, 0, val & 0x00FFFFFF, true); ///< set 3 LSBs of CC\n+ // SEGGER_PRINTF(\"Counter=%u, CC_old=%u, CC_new=%u\", counter_current, cc_current, val);\n}\n}\n+// #endif\n+// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n+\n}\n/**\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
There was a problem with special cases (timer too late, or next CC value too close) when they happened during a 24-bit wrap of the hardware RTC.
It is now fixed.
|
491,595 |
06.08.2018 14:17:25
| 25,200 |
b5dc6c6cd924b10f6b5de199cbee2350e9263ea2
|
don't enable interrupt without entries.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/scum/cm0dsasm.s",
"new_path": "bsp/boards/scum/cm0dsasm.s",
"diff": "@@ -61,7 +61,7 @@ Reset_Handler PROC\nENTRY\nLDR R1, =0xE000E100 ;Interrupt Set Enable Register\n- LDR R0, =0xFF ;<- REMEMBER TO ENABLE THE INTERRUPTS!!\n+ LDR R0, =0xC1 ;<- REMEMBER TO ENABLE THE INTERRUPTS!!\nSTR R0, [R1]\nIMPORT __main\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-770. don't enable interrupt without entries.
|
491,595 |
06.08.2018 14:18:55
| 25,200 |
6747c7e2972079cd41e53d9d75561010ca3066b8
|
use gpio_4-7 as leds since gpio 1 and 2 are used as radio data_in and data_clk_in pin.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/scum/leds.c",
"new_path": "bsp/boards/scum/leds.c",
"diff": "//=========================== public ==========================================\nvoid leds_init(void) {\n- GPIO_REG__OUTPUT &= ~0x0F; // GPIO_REG__OUTPUT = 0bxxxx0000, all LEDs off\n+ GPIO_REG__OUTPUT &= ~0xF0; // GPIO_REG__OUTPUT = 0bxxxx0000, all LEDs off\n}\n// 0 <H17>\nvoid leds_error_on(void) {\n- GPIO_REG__OUTPUT |= 0x01;\n+ GPIO_REG__OUTPUT |= 0x10;\n}\nvoid leds_error_off(void) {\n- GPIO_REG__OUTPUT &= ~0x01;\n+ GPIO_REG__OUTPUT &= ~0x10;\n}\nvoid leds_error_toggle(void) {\n- GPIO_REG__OUTPUT ^= 0x01;\n+ GPIO_REG__OUTPUT ^= 0x10;\n}\nuint8_t leds_error_isOn(void) {\n- return (uint8_t)(GPIO_REG__OUTPUT & 0x01);\n+ return (uint8_t)(GPIO_REG__OUTPUT & 0x10);\n}\n// 1 <K15>\nvoid leds_radio_on(void) {\n- GPIO_REG__OUTPUT |= 0x02;\n+ GPIO_REG__OUTPUT |= 0x20;\n}\nvoid leds_radio_off(void) {\n- GPIO_REG__OUTPUT &= ~0x02;\n+ GPIO_REG__OUTPUT &= ~0x20;\n}\nvoid leds_radio_toggle(void) {\n- GPIO_REG__OUTPUT ^= 0x02;\n+ GPIO_REG__OUTPUT ^= 0x20;\n}\nuint8_t leds_radio_isOn(void) {\n- return (uint8_t)(GPIO_REG__OUTPUT & 0x02)>>1;\n+ return (uint8_t)(GPIO_REG__OUTPUT & 0x20)>>1;\n}\n// 2 <J13>\nvoid leds_sync_on(void) {\n- GPIO_REG__OUTPUT |= 0x04;\n+ GPIO_REG__OUTPUT |= 0x40;\n}\nvoid leds_sync_off(void) {\n- GPIO_REG__OUTPUT &= ~0x04;\n+ GPIO_REG__OUTPUT &= ~0x40;\n}\nvoid leds_sync_toggle(void) {\n- GPIO_REG__OUTPUT ^= 0x04;\n+ GPIO_REG__OUTPUT ^= 0x40;\n}\nuint8_t leds_sync_isOn(void) {\n- return (uint8_t)(GPIO_REG__OUTPUT & 0x04)>>2;\n+ return (uint8_t)(GPIO_REG__OUTPUT & 0x40)>>2;\n}\n// 3 <N14>\nvoid leds_debug_on(void) {\n- GPIO_REG__OUTPUT |= 0x08;\n+ GPIO_REG__OUTPUT |= 0x80;\n}\nvoid leds_debug_off(void) {\n- GPIO_REG__OUTPUT &= ~0x08;\n+ GPIO_REG__OUTPUT &= ~0x80;\n}\nvoid leds_debug_toggle(void) {\n- GPIO_REG__OUTPUT ^= 0x08;\n+ GPIO_REG__OUTPUT ^= 0x80;\n}\nuint8_t leds_debug_isOn(void) {\n- return (uint8_t)(GPIO_REG__OUTPUT & 0x08)>>3;\n+ return (uint8_t)(GPIO_REG__OUTPUT & 0x80)>>3;\n}\nvoid leds_all_on(void) {\n- GPIO_REG__OUTPUT |= 0x0F;\n+ GPIO_REG__OUTPUT |= 0xF0;\n}\nvoid leds_all_off(void) {\n- GPIO_REG__OUTPUT &= ~0x0F;\n+ GPIO_REG__OUTPUT &= ~0xF0;\n}\nvoid leds_all_toggle(void) {\n- GPIO_REG__OUTPUT ^= 0x0F;\n+ GPIO_REG__OUTPUT ^= 0xF0;\n}\nvoid leds_error_blink(void) {\nuint8_t i;\nvolatile uint16_t delay;\n// turn all LEDs off\n- GPIO_REG__OUTPUT &= ~0x0F;\n+ GPIO_REG__OUTPUT &= ~0xF0;\n// blink error LED for ~10s\nfor (i=0;i<80;i++) {\n- GPIO_REG__OUTPUT ^= 0x01;\n+ GPIO_REG__OUTPUT ^= 0x10;\nfor (delay=0xffff;delay>0;delay--);\n}\n}\nvoid leds_circular_shift(void) {\nuint8_t temp_leds;\n- if ((GPIO_REG__OUTPUT & 0x0F)==0) { // if no LEDs on, switch on first one\n- GPIO_REG__OUTPUT |= 0x01;\n+ if ((GPIO_REG__OUTPUT & 0xF0)==0) { // if no LEDs on, switch on first one\n+ GPIO_REG__OUTPUT |= 0x10;\nreturn;\n}\n- temp_leds = GPIO_REG__OUTPUT & 0x0F; // retrieve current status of LEDs\n+ temp_leds = GPIO_REG__OUTPUT & 0xF0; // retrieve current status of LEDs\ntemp_leds <<= 1; // shift by one position\nif ((temp_leds & 0x10)!=0) {\ntemp_leds++; // handle overflow\n}\nGPIO_REG__OUTPUT |= temp_leds; // switch on the leds marked '1' in temp_leds\n- GPIO_REG__OUTPUT &= ~(~temp_leds & 0x0F); // switch off the leds marked '0' in temp_leds\n+ GPIO_REG__OUTPUT &= ~(~temp_leds & 0xF0); // switch off the leds marked '0' in temp_leds\n}\nvoid leds_increment(void) {\nuint8_t led_counter;\n- led_counter = ((GPIO_REG__OUTPUT & 0x0f)+1);\n- GPIO_REG__OUTPUT &= ~0x0f; //all LEDs off\n- GPIO_REG__OUTPUT |= led_counter & 0x0f; //LEDs on again\n+ led_counter = ((GPIO_REG__OUTPUT & 0xf0)+0x10);\n+ GPIO_REG__OUTPUT &= ~0xf0; //all LEDs off\n+ GPIO_REG__OUTPUT |= led_counter & 0xf0; //LEDs on again\n}\n//=========================== private =========================================\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-770. use gpio_4-7 as leds since gpio 1 and 2 are used as radio data_in and data_clk_in pin.
|
491,595 |
06.08.2018 14:19:30
| 25,200 |
c215c03330936478b98d709d1740748665c8efd2
|
call functions after initializing variables.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/scum/radio.c",
"new_path": "bsp/boards/scum/radio.c",
"diff": "@@ -249,11 +249,11 @@ kick_scheduler_t radio_isr(void) {\nPORT_TIMER_WIDTH capturedTime;\n- debugpins_isr_set();\n-\nPORT_TIMER_WIDTH irq_status = RFCONTROLLER_REG__INT;\nPORT_TIMER_WIDTH irq_error = RFCONTROLLER_REG__ERROR;\n+ debugpins_isr_set();\n+\n#ifdef SLOT_FSM_IMPLEMENTATION_MULTIPLE_TIMER_INTERRUPT\n#else\ncapturedTime = sctimer_readCounter();\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-770. call functions after initializing variables.
|
491,595 |
06.08.2018 14:23:44
| 25,200 |
8e400347bfee74687f0a1f6df6dc51a00f1fca3c
|
scan chain need to be initialized at beginning.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/scum/board.c",
"new_path": "bsp/boards/scum/board.c",
"diff": "#include \"radio.h\"\n#include \"eui64.h\"\n#include \"sctimer.h\"\n+#include \"scm3_hardware_interface.h\"\n//=========================== variables =======================================\n@@ -31,6 +32,9 @@ int main(void) {\nvoid board_init(void) {\nuint8_t eui[8];\n+ // initialize the scan chain\n+ initialize_ASC();\n+\n// initialize bsp modules\ndebugpins_init();\nleds_init();\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/scum/memory_map.h",
"new_path": "bsp/boards/scum/memory_map.h",
"diff": "#define GPIO_REG__INPUT *(unsigned int*)(APB_GPIO_BASE + 0x000000)\n#define GPIO_REG__OUTPUT *(unsigned int*)(APB_GPIO_BASE + 0x040000)\n+\n+// ========================== Analog Configure Registers\n+\n+#define ANALOG_CFG_REG__0 *(unsigned int*)(APB_ANALOG_CFG_BASE + 0x000000)\n+#define ANALOG_CFG_REG__22 *(unsigned int*)(APB_ANALOG_CFG_BASE + 0x580000)\n+\n+#define ACFG_LO__ADDR *(unsigned int*)(APB_ANALOG_CFG_BASE + 0x001C0000)\n+#define ACFG_LO__ADDR_2 *(unsigned int*)(APB_ANALOG_CFG_BASE + 0x00200000)\n+\n+#define ISER *(unsigned int*)(0xE000E100)\n+#define ICER *(unsigned int*)(0xE000E180)\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "bsp/boards/scum/scm3_hardware_interface.c",
"diff": "+#include <stdio.h>\n+#include <stdlib.h>\n+#include <stdbool.h>\n+#include \"memory_Map.h\"\n+\n+unsigned int ASC[38];\n+char send_packet[127];\n+\n+unsigned int current_lfsr = 0x12345678;\n+\n+/* START 2 MHz oscillator related variables */\n+bool read_counters_now = false;\n+\n+// coarse1, coarse2, coarse3, fine, superfine dac settings\n+unsigned int dac_2M_settings[5] = {31, 31, 29, 2, 2};\n+\n+// buffer of the last ten valid samples\n+int buffer_samples[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};\n+\n+// blip defined as blip_threshold_ticks ticks below the rolling average\n+int blip_threshold_ticks = 100;\n+\n+//threshold above which we adjust the 2 MHz dac\n+int calibration_threshold_max = 200100;\n+//threshold below which we adjust the 2 MHz dac\n+int calibration_threshold_min = 199900;\n+\n+// resolution of DAC components in ticks/Hz\n+double fine_resolution = 165;\n+double superfine_resolution = 55;\n+\n+// These booleans control modifying of each of the 2 MHz DAC components.\n+bool modify_coarse1 = false;\n+bool modify_coarse2 = false;\n+bool modify_coarse3 = true;\n+bool modify_fine = true;\n+bool modify_superfine = true;\n+\n+//This boolean is true if we have received < 10 packets after changing the DAC settings.\n+bool first_ten = true;\n+\n+// 10-point rolling average of the 2 MHz counter\n+double rolling_average_2M = 200000;\n+\n+// number of packets received with the current DAC setting\n+int num_iterations_with_dac_setting = 0;\n+\n+// general-purpose index for iterating through arrays\n+int temp_index = 0;\n+\n+/* END 2 MHz oscillator related variables */\n+\n+\n+// Reverse endianness of lower 16 bits\n+unsigned int flip_lsb8(unsigned int in){\n+ int out = 0;\n+\n+ out |= (0x01 & in) << 7;\n+ out |= (0x02 & in) << 5;\n+ out |= (0x04 & in) << 3;\n+ out |= (0x08 & in) << 1;\n+\n+ out |= (0x10 & in) >> 1;\n+ out |= (0x20 & in) >> 3;\n+ out |= (0x40 & in) >> 5;\n+ out |= (0x80 & in) >> 7;\n+\n+ return out;\n+}\n+\n+void analog_scan_chain_write(unsigned int* scan_bits) {\n+\n+ int i = 0;\n+ int j = 0;\n+ unsigned int asc_reg;\n+\n+ // analog_cfg<357> is resetb for chip shift register, so leave that high\n+\n+ for (i=37; i>=0; i--) {\n+\n+ //printf(\"\\n%d,%lX\\n\",i,scan_bits[i]);\n+\n+ for (j=0; j<32; j++) {\n+\n+ // Set scan_in (should be inverted)\n+ if((scan_bits[i] & (0x00000001 << j)) == 0)\n+ asc_reg = 0x21;\n+ else\n+ asc_reg = 0x20;\n+\n+ // Write asc_reg to analog_cfg\n+ ANALOG_CFG_REG__22 = asc_reg;\n+\n+ // Lower phi1\n+ asc_reg &= ~(0x2);\n+ ANALOG_CFG_REG__22 = asc_reg;\n+\n+ // Toggle phi2\n+ asc_reg |= 0x4;\n+ ANALOG_CFG_REG__22 = asc_reg;\n+ asc_reg &= ~(0x4);\n+ ANALOG_CFG_REG__22 = asc_reg;\n+\n+ // Raise phi1\n+ asc_reg |= 0x2;\n+ ANALOG_CFG_REG__22 = asc_reg;\n+\n+ }\n+ }\n+}\n+\n+void analog_scan_chain_load() {\n+\n+ // Assert load signal (and cfg<357>)\n+ ANALOG_CFG_REG__22 = 0x0028;\n+\n+ // Lower load signal\n+ ANALOG_CFG_REG__22 = 0x0020;\n+\n+}\n+\n+\n+/* Prints the value of the 2MHz dac.*/\n+void print_2MHz_DAC() {\n+ int ind;\n+ // print the DAC settings\n+ //printf(\"2MHz DAC: \");\n+ for (ind = 0; ind < 5; ind++) {\n+ printf(\"%d, \", dac_2M_settings[ind]);\n+ }\n+ printf(\"\\n\");\n+}\n+\n+\n+/* Returns the approximate 2M counter value expected if changing the fine/superfine dac values to the new values.\n+int approximate_2M_counter(int new_fine_code, int new_superfine_code) {\n+ int fine_below;\n+ int superfine_below;\n+\n+ fine_below = (new_fine_code - 2) * fine_resolution;\n+ superfine_below = (new_superfine_code - 2) * superfine_resolution;\n+\n+ return (200000 - fine_below - superfine_below);\n+}\n+*/\n+\n+/* sets the 2 MHz RC DAC frequency.\n+-updates the local dac settings array\n+-flips endianness and sets the appropriate bits in the scanchain array\n+-writes it to the scanchain\n+-loads the scanchain\n+*/\n+void set_2M_RC_frequency(int coarse1, int coarse2, int coarse3, int fine, int superfine) {\n+\n+ unsigned int newval;\n+ unsigned int newcoarse1, newcoarse2, newcoarse3, newfine, newsuperfine;\n+ unsigned int temp;\n+\n+ /* update our local dac array */\n+ dac_2M_settings[0] = coarse1;\n+ dac_2M_settings[1] = coarse2;\n+ dac_2M_settings[2] = coarse3;\n+ dac_2M_settings[3] = fine;\n+ dac_2M_settings[4] = superfine;\n+\n+ // make sure each argument is between 0-31, inclusive\n+\n+ // ASC[34] covers 1088:1119\n+ newval = ASC[34] & 0x8000001F;\n+\n+ // flip endianness of each\n+ newcoarse1 = (flip_lsb8(coarse1) >> 3) & 0x1F;\n+ newcoarse2 = (flip_lsb8(coarse2) >> 3) & 0x1F;\n+ newcoarse3 = (flip_lsb8(coarse3) >> 3) & 0x1F;\n+ newfine = (flip_lsb8(fine) >> 3) & 0x1F;\n+ newsuperfine = (flip_lsb8(superfine) >> 3) & 0x1F;\n+\n+ newval |= newcoarse1 << 26;\n+ newval |= newcoarse2 << 21;\n+ newval |= newcoarse3 << 16;\n+ newval |= newfine << 11;\n+ newval |= newsuperfine << 6;\n+\n+ // Enable bit\n+ newval |= 0x1 << 5;\n+\n+ ASC[34] = newval;\n+\n+ num_iterations_with_dac_setting = 0;\n+\n+ /* flush the buffer so every subsequent read is not considered a blip.*/\n+ for (temp_index = 0; temp_index < 9; temp_index++) {\n+ buffer_samples[temp_index] = 0;\n+ }\n+ /* set the first_ten boolean back to true so we don't check for blips in the first ten packets.*/\n+ first_ten = true;\n+\n+ //write to analog scanchain and load\n+ analog_scan_chain_write(&ASC[0]);\n+ analog_scan_chain_load();\n+\n+ //print_2MHz_DAC();\n+}\n+\n+\n+/* Initializes the 2MHz DAC with values set in the dac_2M_settings array. */\n+void initialize_2M_DAC() {\n+ set_2M_RC_frequency(dac_2M_settings[0], dac_2M_settings[1], dac_2M_settings[2], dac_2M_settings[3], dac_2M_settings[4]);\n+ // printf(\"Initialized 2MHz DAC\\n\");\n+ // print_2MHz_DAC();\n+}\n+\n+\n+/* returns 1 if the counter was not a blip, on comparison to the rolling average.\n+Otherwise, returns 0.\n+*/\n+int valid_2M_read(int counter) {\n+\n+ int lower_threshold;\n+ int upper_threshold;\n+\n+ if (first_ten) {\n+ //lower_threshold = 200000 - blip_threshold_ticks;\n+ //upper_threshold = 200000 + blip_threshold_ticks;\n+ return 1;\n+ } else {\n+ // +/- blip_threshold_ticks around the rolling average.\n+ lower_threshold = rolling_average_2M - blip_threshold_ticks;\n+ upper_threshold = rolling_average_2M + blip_threshold_ticks;\n+ }\n+ //printf(\"L: %d, U: %d\\n\", lower_threshold, upper_threshold);\n+\n+ if ((counter < lower_threshold) || (counter > upper_threshold)) {\n+ printf(\"Blip, %d\\n\", counter);\n+ return 0;\n+ }\n+\n+ return 1;\n+}\n+\n+/* Returns 1 if rolling_average_2M is within the calibration window (cal not needed).\n+Otherwise, returns 0.*/\n+int is_2M_within_cal_window() {\n+ if ((rolling_average_2M < calibration_threshold_min) ||\n+ (rolling_average_2M > calibration_threshold_max)) {\n+ return 0;\n+ }\n+ return 1;\n+}\n+\n+/* Takes in COUNTER, which is the number of ticks elapsed since resetting the 2MHz counter.\n+Adjusts the 2MHz DAC one bit at a time to bring COUNTER closer to 200000\n+which is the number of ticks of the clock in 100ms.\n+\n+Returns 0 if no calibration occurs, 1 if the DAC was changed.\n+*/\n+int cal_2M_RC() {\n+ int ind;\n+ int counter_dif;\n+ //printf(\"Calibrating 2M oscillator.\\n\");\n+\n+ /* increment the DAC setting to lower the frequency.*/\n+\n+ // change this condition to match calibration threshold variables defined at the top.\n+ if (rolling_average_2M > calibration_threshold_max) {\n+\n+ if ((dac_2M_settings[4] < 31) && (modify_superfine)) {\n+ // superfine\n+ dac_2M_settings[4] += 1;\n+ } else if ((dac_2M_settings[3] < 31) && (modify_fine)) {\n+ // fine\n+ dac_2M_settings[3] += 1;\n+ } else if ((dac_2M_settings[2] < 31) && (modify_coarse3)) {\n+ // coarse 3\n+ dac_2M_settings[2] += 1;\n+ // reset fine and superfine so we can modify them again.\n+ dac_2M_settings[3] = 15;\n+ dac_2M_settings[4] = 15;\n+ } else if ((dac_2M_settings[1] < 31) && (modify_coarse2)) {\n+ // coarse 2\n+ dac_2M_settings[1] += 1;\n+ } else if ((dac_2M_settings[0] < 31) && (modify_coarse1)) {\n+ // coarse 1\n+ dac_2M_settings[0] += 1;\n+ } else {\n+ }\n+\n+ /* coarse1 -> coarse2 -> coarse3 -> fine -> superfine\n+ if ((dac_2M_settings[0] < 31) && (modify_coarse1)) {\n+ // coarse 1\n+ dac_2M_settings[0] += 1;\n+ } else if ((dac_2M_settings[1] < 31) && (modify_coarse2)) {\n+ // coarse 2\n+ dac_2M_settings[1] += 1;\n+ } else if ((dac_2M_settings[2] < 31) && (modify_coarse3)) {\n+ // coarse 3\n+ dac_2M_settings[2] += 1;\n+ } else if ((dac_2M_settings[3] < 31) && (modify_fine)) {\n+ // fine\n+ dac_2M_settings[3] += 1;\n+ } else if ((dac_2M_settings[4] < 31) && (modify_superfine)) {\n+ // superfine\n+ dac_2M_settings[4] += 1;\n+ } else {\n+ // DAC settings are maxed out.\n+ } */\n+ }\n+\n+ /* decrement the DAC setting to increase the frequency.*/\n+ else {\n+\n+ if ((dac_2M_settings[4] > 0) && (modify_superfine)) {\n+ // superfine\n+ dac_2M_settings[4] -= 1;\n+ } else if ((dac_2M_settings[3] > 0) && (modify_fine)) {\n+ // fine\n+ dac_2M_settings[3] -= 1;\n+ } else if ((dac_2M_settings[2] > 0) && (modify_coarse3)) {\n+ // coarse 3\n+ dac_2M_settings[2] -= 1;\n+ // adjust fine and superfine so we can adjust them again\n+ dac_2M_settings[3] = 15;\n+ dac_2M_settings[4] = 15;\n+ } else if ((dac_2M_settings[1] > 0) && (modify_coarse2)) {\n+ // coarse 2\n+ dac_2M_settings[1] -= 1;\n+ } else if ((dac_2M_settings[0] > 0) && (modify_coarse1)) {\n+ // start with coarse 1\n+ dac_2M_settings[0] -= 1;\n+ } else {\n+ }\n+\n+ /* coarse1 -> coarse2 -> coarse3 -> fine -> superfine\n+ if ((dac_2M_settings[0] > 0) && (modify_coarse1)) {\n+ // start with coarse 1\n+ dac_2M_settings[0] -= 1;\n+ } else if ((dac_2M_settings[1] > 0) && (modify_coarse2)) {\n+ // coarse 2\n+ dac_2M_settings[1] -= 1;\n+ } else if ((dac_2M_settings[2] > 0) && (modify_coarse3)) {\n+ // coarse 3\n+ dac_2M_settings[2] -= 1;\n+ } else if ((dac_2M_settings[3] > 0) && (modify_fine)) {\n+ // fine\n+ dac_2M_settings[3] -= 1;\n+ } else if ((dac_2M_settings[4] > 0) && (modify_superfine)) {\n+ // superfine\n+ dac_2M_settings[4] -= 1;\n+ } else {\n+ // DAC settings are maxed out.\n+ } */\n+ }\n+\n+ set_2M_RC_frequency(dac_2M_settings[0], dac_2M_settings[1], dac_2M_settings[2], dac_2M_settings[3], dac_2M_settings[4]);\n+ //printf(\"Cal\\n\");\n+ // print the DAC settings\n+ print_2MHz_DAC();\n+ return 1;\n+}\n+\n+\n+void LC_FREQCHANGE(char coarse, char mid, char fine){\n+\n+ // mask to ensure that the coarse, mid, and fine are actually 5-bit\n+ char coarse_m = coarse & 0x1F;\n+ char mid_m = mid & 0x1F;\n+ char fine_m = fine & 0x1F;\n+ char coarse_m2 = 0x0;\n+ char mid_m2 = 0x0;\n+ char fine_m2 = 0x0;\n+\n+ // shift bits in\n+ unsigned int fcode = 0x00000000;\n+ unsigned int fcode2 = 0x00000000;\n+\n+ // Flip endianness\n+ coarse_m2 |= (0x01 & coarse_m) << 4;\n+ coarse_m2 |= (0x02 & coarse_m) << 2;\n+ coarse_m2 |= (0x04 & coarse_m);\n+ coarse_m2 |= (0x08 & coarse_m) >> 2;\n+ coarse_m2 |= (0x10 & coarse_m) >> 4;\n+\n+ mid_m2 |= (0x01 & mid_m) << 4;\n+ mid_m2 |= (0x02 & mid_m) << 2;\n+ mid_m2 |= (0x04 & mid_m);\n+ mid_m2 |= (0x08 & mid_m) >> 2;\n+ mid_m2 |= (0x10 & mid_m) >> 4;\n+\n+ fine_m2 |= (0x01 & fine_m) << 4;\n+ fine_m2 |= (0x02 & fine_m) << 2;\n+ fine_m2 |= (0x04 & fine_m);\n+ fine_m2 |= (0x08 & fine_m) >> 2;\n+ fine_m2 |= (0x10 & fine_m) >> 4;\n+\n+\n+ fcode |= coarse_m2;\n+ fcode |= mid_m2 << 6;\n+ fcode |= (fine_m2 & 0xF) << 12;\n+\n+ fcode2 |= fine_m2 >> 4;\n+\n+ // set the memory and prevent any overwriting of other analog config\n+ ACFG_LO__ADDR = fcode;\n+ ACFG_LO__ADDR_2 = fcode2;\n+\n+ // acknowledge that this was run\n+ //printf(\"LC frequency set %X\\n\",fcode);\n+ //printf(\"LC frequency set %X\\n\",fcode2);\n+\n+}\n+\n+/* Checks the bit position of GP input 12 (which we have connected to the 2 MHz RC output\n+from GPIO); if high, return true, else return false.*/\n+bool is_2M_high(void) {\n+ if ((GPIO_REG__INPUT & (1 << 12)) == 0x1000) {\n+ return true;\n+ }\n+ return false;\n+}\n+\n+\n+/* Waits until the 2 MHz RC signal is high before executing function F.*/\n+void execute_func( void (*f) (void)) {\n+ while (!is_2M_high()) {\n+ }\n+ (*f)();\n+}\n+\n+/* disables all counters.*/\n+void disable_counters(void) {\n+ // Disable all counters\n+ ANALOG_CFG_REG__0 = 0x007F;\n+}\n+\n+\n+/* reset counters */\n+void reset_counters(void) {\n+ // Reset all counters\n+ ANALOG_CFG_REG__0 = 0x0000;\n+}\n+\n+\n+/* enable counters */\n+void enable_counters(void) {\n+ // Enable all counters\n+ ANALOG_CFG_REG__0 = 0x3FFF;\n+}\n+\n+\n+void read_counters(unsigned int* count_2M, unsigned int* count_LC, unsigned int* count_32k, unsigned int* count_ringDiv8){\n+\n+ unsigned int rdata_lsb, rdata_msb;\n+\n+ // Disable all counters\n+ //execute_func(disable_counters);\n+ // Disable all counters\n+ ANALOG_CFG_REG__0 = 0x007F;\n+\n+ /*\n+ // Read 2M counter\n+ rdata_lsb = *(unsigned int*)(APB_ANALOG_CFG_BASE + 0x180000);\n+ rdata_msb = *(unsigned int*)(APB_ANALOG_CFG_BASE + 0x1C0000);\n+ *count_2M = rdata_lsb + (rdata_msb << 16);\n+ */\n+\n+ /*\n+ // Read LC_div counter (via counter4)\n+ rdata_lsb = *(unsigned int*)(APB_ANALOG_CFG_BASE + 0x200000);\n+ rdata_msb = *(unsigned int*)(APB_ANALOG_CFG_BASE + 0x240000);\n+ *count_LC = rdata_lsb + (rdata_msb << 16);\n+\n+ // Read 32k counter\n+ rdata_lsb = *(unsigned int*)(APB_ANALOG_CFG_BASE + 0x000000);\n+ rdata_msb = *(unsigned int*)(APB_ANALOG_CFG_BASE + 0x040000);\n+ *count_32k = rdata_lsb + (rdata_msb << 16);\n+ */\n+\n+ // ring div 8 counter\n+ //rdata_lsb = *(unsigned int*)(APB_ANALOG_CFG_BASE + 0x200000);\n+ //rdata_msb = *(unsigned int*)(APB_ANALOG_CFG_BASE + 0x240000);\n+ //*count_ringDiv8 = rdata_lsb + (rdata_msb << 16);\n+\n+ // Reset all counters\n+ //execute_func(reset_counters);\n+ // Reset all counters\n+ ANALOG_CFG_REG__0 = 0x0000;\n+\n+ // Enable all counters\n+ //execute_func(enable_counters);\n+ // Enable all counters\n+ ANALOG_CFG_REG__0 = 0x3FFF;\n+\n+ //printf(\"%d \",*count_LC);\n+ printf(\"%d\\n\",*count_2M); //2 MHz counter\n+ //printf(\"%d\\n\",*count_ringDiv8); //RINGDIV8 counter\n+ //printf(\"%d\",*count_32k); //32khz counter\n+}\n+\n+void read_2M_counter(unsigned int* count_2M) {\n+ unsigned int rdata_lsb, rdata_msb;\n+\n+ // Disable all counters\n+ ANALOG_CFG_REG__0 = 0x007F;\n+\n+ // Read 2M counter into the count_2M pointer\n+ rdata_lsb = *(unsigned int*)(APB_ANALOG_CFG_BASE + 0x180000);\n+ rdata_msb = *(unsigned int*)(APB_ANALOG_CFG_BASE + 0x1C0000);\n+ *count_2M = rdata_lsb + (rdata_msb << 16);\n+\n+ // Reset all counters\n+ ANALOG_CFG_REG__0 = 0x0000;\n+\n+ // Enable all counters\n+ ANALOG_CFG_REG__0 = 0x3FFF;\n+\n+ //printf(\"%d\\n\",*count_2M); //2 MHz counter\n+}\n+\n+\n+void add_sample_to_buffer(int new_sample, int offset) {\n+ int pos = offset % 10;\n+ buffer_samples[pos] = new_sample;\n+ return;\n+}\n+\n+\n+/* Computes the average of samples in buffer_samples.\n+If any value in the array is 0, it is not counted.\n+\n+If the rolling average is outside the calibration threshold, we calibrate the dac.\n+*/\n+void compute_2M_rolling_average() {\n+ int index;\n+ double average;\n+ int sum = 0;\n+ int curr_sample;\n+ int num_legit_samples = 0;\n+ for (index = 0; index < 10; index++) {\n+ curr_sample = buffer_samples[index];\n+ if (curr_sample != 0) {\n+ sum += curr_sample;\n+ num_legit_samples += 1;\n+ }\n+ }\n+ average = sum / num_legit_samples;\n+ //printf(\"2M Av: %f\\n\", average);\n+ rolling_average_2M = average;\n+\n+ // calibrate if necessary\n+ // calibrate dac if rolling average is out of calibration threshold\n+ if (!is_2M_within_cal_window() && !first_ten) {\n+ //cal_2M_RC();\n+ }\n+}\n+\n+\n+void initialize_ASC(){\n+\n+ ASC[0] = 0xC0000000; //0-31\n+ ASC[1] = 0x00000000; //32-63\n+ ASC[2] = 0x00000000; //64-95\n+ ASC[3] = 0x00000000; //96-127\n+ ASC[4] = 0x00000000; //128-159\n+ ASC[5] = 0x00000000; //160-191\n+ ASC[6] = 0x00000000; //192-223\n+ ASC[7] = 0x00000099; //224-255\n+ ASC[8] = 0x91C3FFFF; //256-287\n+ ASC[9] = 0xE0C66388; //288-319\n+ ASC[10] = 0x88040020; //320-351\n+ ASC[11] = 0x000C0000; //352-383\n+ ASC[12] = 0x00180000; //384-415\n+ ASC[13] = 0x03D04000; //416-447\n+ ASC[14] = 0x200100FF; //448-479\n+ ASC[15] = 0xFBF02857; //480-511\n+ ASC[16] = 0x97FFFF00; //512-543\n+ ASC[17] = 0x22300080; //544-575\n+ ASC[18] = 0x010205F9; //576-607\n+ ASC[19] = 0x0506E7E8; //608-639\n+ ASC[20] = 0x10200040; //640-671\n+ ASC[21] = 0x03111810; //672-703\n+ ASC[22] = 0x2FFFFC00; //704-735\n+ ASC[23] = 0x20000000; //736-767\n+ ASC[24] = 0x00007CFC; //768-799\n+ ASC[25] = 0x10000018; //800-831\n+ ASC[26] = 0x02800000; //832-863\n+ ASC[27] = 0x00000000; //864-895\n+ ASC[28] = 0x00000000; //896-927\n+ ASC[29] = 0x00000000; //928-959\n+ ASC[30] = 0x00000000; //960-991\n+ ASC[31] = 0x000007FC; //992-1023\n+ ASC[32] = 0x80000012; //1024-1055\n+ ASC[33] = 0xC004B000; //1056-1087\n+ ASC[34] = 0x7C000015; //1088-1119 enable GPIO\n+ //ASC[35] = 0x4AB54AA0; //1120-1151\n+ ASC[35] = 0x4AAAAAA0; //GPIO 0- 3 in\n+\n+ ASC[36] = 0x00000000; //1152-1183\n+ ASC[37] = 0x00000000;\n+\n+ /*\n+ASC[0] = 0xFF8002FF; //0-31\n+ASC[1] = 0xFFE03020; //32-63\n+ASC[2] = 0x20202000; //64-95\n+ASC[3] = 0x00160006; //96-127\n+ASC[4] = 0x48000000; //128-159\n+ASC[5] = 0x00000000; //160-191\n+ASC[6] = 0x00003000; //192-223\n+ASC[7] = 0x00034099; //224-255\n+ASC[8] = 0x9900FFFF; //256-287\n+ASC[9] = 0xE0423100; //288-319\n+ASC[10] = 0x000A0060; //320-351\n+ASC[11] = 0x000C0912; //352-383\n+ASC[12] = 0x4A7F9F06; //384-415\n+ASC[13] = 0x076082C4; //416-447\n+ASC[14] = 0x607D0007; //448-479\n+ASC[15] = 0xFFE00B01; //480-511\n+ASC[16] = 0xCFFFFF00; //512-543\n+ASC[17] = 0x22300080; //544-575\n+ASC[18] = 0x010205F9; //576-607\n+ASC[19] = 0x0506E7E8; //608-639\n+ASC[20] = 0x10200040; //640-671\n+ASC[21] = 0x03111810; //672-703\n+ASC[22] = 0x2FFFFC00; //704-735\n+ASC[23] = 0x20000000; //736-767\n+ASC[24] = 0x00007CFC; //768-799\n+ASC[25] = 0x20000018; //800-831\n+ASC[26] = 0x02800000; //832-863\n+ASC[27] = 0x00000000; //864-895\n+ASC[28] = 0x00000808; //896-927\n+ASC[29] = 0x00780072; //928-959\n+ASC[30] = 0xA0100007; //960-991\n+ASC[31] = 0xF7000804; //992-1023\n+ASC[32] = 0xE0603C7F; //1024-1055\n+ASC[33] = 0x09E4B084; //1056-1087\n+ASC[34] = 0x7FE379B5; //1088-1119\n+ASC[35] = 0x4AAAAAA0; //1120-1151\n+ASC[36] = 0x00000000; //1152-1183\n+ASC[37] = 0x00000000;\n+*/\n+\n+ analog_scan_chain_write(&ASC[0]);\n+ analog_scan_chain_load();\n+}\n+\n+\n+void update_PN31_byte(unsigned int* current_lfsr){\n+ int i;\n+\n+ for(i=0; i<8; i++){\n+ int newbit = (((*current_lfsr >> 30) ^ (*current_lfsr >> 27)) & 1);\n+ *current_lfsr = ((*current_lfsr << 1) | newbit);\n+ }\n+}\n+\n+\n+void TX_load_PN_data(unsigned int num_bytes){\n+ int i;\n+ for(i=0; i<num_bytes; i++){\n+ send_packet[i] = (char)(current_lfsr & 0xFF);\n+ }\n+\n+ RFCONTROLLER_REG__TX_PACK_LEN = num_bytes;\n+ RFCONTROLLER_REG__CONTROL = 0x1; // \"lod\"\n+}\n+\n+void TX_load_counter_data(unsigned int num_bytes){\n+ int i;\n+ for(i=0; i<num_bytes; i++){\n+ send_packet[i] = (char)(0x30 + i);\n+ }\n+\n+ RFCONTROLLER_REG__TX_PACK_LEN = num_bytes;\n+ RFCONTROLLER_REG__CONTROL = 0x1; // \"lod\"\n+}\n+\n+\n+\n+\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "bsp/boards/scum/scm3_hardware_interface.h",
"diff": "+unsigned int flip_lsb8(unsigned int in);\n+void analog_scan_chain_write(unsigned int* scan_bits);\n+void analog_scan_chain_load(void);\n+\n+int approximate_2M_counter(int new_fine_code, int new_superfine_code);\n+void set_2M_RC_frequency(int coarse1, int coarse2, int coarse3, int fine, int superfine);\n+void print_2MHz_DAC(void);\n+void initialize_2M_DAC(void);\n+\n+int valid_2M_read(int counter);\n+int is_2M_within_cal_window(void);\n+\n+int cal_2M_RC(void);\n+void LC_FREQCHANGE(char coarse, char mid, char fine);\n+\n+bool is_2M_high(void);\n+void execute_func( void (*f) (void));\n+void disable_counters(void);\n+void reset_counters(void);\n+void enable_counters(void);\n+\n+\n+void initialize_ASC(void);\n+void read_counters(unsigned int* count_2M, unsigned int* count_LC, unsigned int* count_32k, unsigned int* count_ringDiv8);\n+void read_2M_counter(unsigned int* count_2M);\n+\n+void add_sample_to_buffer(int new_sample, int offset);\n+double compute_2M_rolling_average(void);\n+\n+void update_PN31_byte(unsigned int* current_lfsr);\n+void TX_load_PN_data(unsigned int num_bytes);\n+void TX_load_counter_data(unsigned int num_bytes);\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-770. scan chain need to be initialized at beginning.
|
491,595 |
06.08.2018 16:02:31
| 25,200 |
9568a286cf222736078da8a15ac00508feb98f84
|
implement debugpins for SCuMv3b.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/scum/debugpins.c",
"new_path": "bsp/boards/scum/debugpins.c",
"diff": "@@ -18,77 +18,78 @@ To be implemented after issue: SCUM-25\n//=========================== public ==========================================\nvoid debugpins_init(void) {\n- // empty for now, see https://openwsn.atlassian.net/browse/SCUM-25\n+ // GPIO pin 8 to 13 are used as debugpins,\n+ GPIO_REG__OUTPUT &= ~0x3F00; // all PINS low at initial\n}\nvoid debugpins_frame_toggle(void) {\n- // empty for now, see https://openwsn.atlassian.net/browse/SCUM-25\n+ GPIO_REG__OUTPUT ^= 0x0100;\n}\nvoid debugpins_frame_clr(void) {\n- // empty for now, see https://openwsn.atlassian.net/browse/SCUM-25\n+ GPIO_REG__OUTPUT &= ~0x0100;\n}\nvoid debugpins_frame_set(void) {\n- // empty for now, see https://openwsn.atlassian.net/browse/SCUM-25\n+ GPIO_REG__OUTPUT |= 0x0100;\n}\nvoid debugpins_slot_toggle(void) {\n- // empty for now, see https://openwsn.atlassian.net/browse/SCUM-25\n+ GPIO_REG__OUTPUT ^= 0x0200;\n}\nvoid debugpins_slot_clr(void) {\n- // empty for now, see https://openwsn.atlassian.net/browse/SCUM-25\n+ GPIO_REG__OUTPUT &= ~0x0200;\n}\nvoid debugpins_slot_set(void) {\n- // empty for now, see https://openwsn.atlassian.net/browse/SCUM-25\n+ GPIO_REG__OUTPUT |= 0x0200;\n}\nvoid debugpins_fsm_toggle(void) {\n- // empty for now, see https://openwsn.atlassian.net/browse/SCUM-25\n+ GPIO_REG__OUTPUT ^= 0x0400;\n}\nvoid debugpins_fsm_clr(void) {\n- // empty for now, see https://openwsn.atlassian.net/browse/SCUM-25\n+ GPIO_REG__OUTPUT &= ~0x0400;\n}\nvoid debugpins_fsm_set(void) {\n- // empty for now, see https://openwsn.atlassian.net/browse/SCUM-25\n+ GPIO_REG__OUTPUT |= 0x0400;\n}\nvoid debugpins_task_toggle(void) {\n- // empty for now, see https://openwsn.atlassian.net/browse/SCUM-25\n+ GPIO_REG__OUTPUT ^= 0x0800;\n}\nvoid debugpins_task_clr(void) {\n- // empty for now, see https://openwsn.atlassian.net/browse/SCUM-25\n+ GPIO_REG__OUTPUT &= ~0x0800;\n}\nvoid debugpins_task_set(void) {\n- // empty for now, see https://openwsn.atlassian.net/browse/SCUM-25\n+ GPIO_REG__OUTPUT |= 0x0800;\n}\nvoid debugpins_isr_toggle(void) {\n- // empty for now, see https://openwsn.atlassian.net/browse/SCUM-25\n+ GPIO_REG__OUTPUT ^= 0x1000;\n}\nvoid debugpins_isr_clr(void) {\n- // empty for now, see https://openwsn.atlassian.net/browse/SCUM-25\n+ GPIO_REG__OUTPUT &= ~0x1000;\n}\nvoid debugpins_isr_set(void) {\n- // empty for now, see https://openwsn.atlassian.net/browse/SCUM-25\n+ GPIO_REG__OUTPUT |= 0x1000;\n}\nvoid debugpins_radio_toggle(void) {\n- // empty for now, see https://openwsn.atlassian.net/browse/SCUM-25\n+ GPIO_REG__OUTPUT ^= 0x2000;\n}\nvoid debugpins_radio_clr(void) {\n- // empty for now, see https://openwsn.atlassian.net/browse/SCUM-25\n+ GPIO_REG__OUTPUT &= ~0x2000;\n}\nvoid debugpins_radio_set(void) {\n- // empty for now, see https://openwsn.atlassian.net/browse/SCUM-25\n+ GPIO_REG__OUTPUT |= 0x2000;\n}\n\\ No newline at end of file\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "projects/scum/01bsp_debugpins/01bsp_debugpins.uvprojx",
"diff": "+<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\" ?>\n+<Project xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"project_projx.xsd\">\n+\n+ <SchemaVersion>2.1</SchemaVersion>\n+\n+ <Header>### uVision Project, (C) Keil Software</Header>\n+\n+ <Targets>\n+ <Target>\n+ <TargetName>Target SCuM</TargetName>\n+ <ToolsetNumber>0x4</ToolsetNumber>\n+ <ToolsetName>ARM-ADS</ToolsetName>\n+ <pCCUsed>5060528::V5.06 update 5 (build 528)::ARMCC</pCCUsed>\n+ <uAC6>0</uAC6>\n+ <TargetOption>\n+ <TargetCommonOption>\n+ <Device>ARMCM0</Device>\n+ <Vendor>ARM</Vendor>\n+ <PackID>ARM.CMSIS.5.0.1</PackID>\n+ <PackURL>http://www.keil.com/pack/</PackURL>\n+ <Cpu>IRAM(0x20000000,0x20000) IROM(0x00000000,0x40000) CPUTYPE(\"Cortex-M0\") CLOCK(12000000) ESEL ELITTLE</Cpu>\n+ <FlashUtilSpec></FlashUtilSpec>\n+ <StartupFile></StartupFile>\n+ <FlashDriverDll>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0NEW_DEVICE -FS00 -FL040000 -FP0($$Device:ARMCM0$Device\\ARM\\Flash\\NEW_DEVICE.FLM))</FlashDriverDll>\n+ <DeviceId>0</DeviceId>\n+ <RegisterFile>$$Device:ARMCM0$Device\\ARM\\ARMCM0\\Include\\ARMCM0.h</RegisterFile>\n+ <MemoryEnv></MemoryEnv>\n+ <Cmp></Cmp>\n+ <Asm></Asm>\n+ <Linker></Linker>\n+ <OHString></OHString>\n+ <InfinionOptionDll></InfinionOptionDll>\n+ <SLE66CMisc></SLE66CMisc>\n+ <SLE66AMisc></SLE66AMisc>\n+ <SLE66LinkerMisc></SLE66LinkerMisc>\n+ <SFDFile>$$Device:ARMCM0$Device\\ARM\\SVD\\ARMCM0.svd</SFDFile>\n+ <bCustSvd>0</bCustSvd>\n+ <UseEnv>0</UseEnv>\n+ <BinPath></BinPath>\n+ <IncludePath></IncludePath>\n+ <LibPath></LibPath>\n+ <RegisterFilePath></RegisterFilePath>\n+ <DBRegisterFilePath></DBRegisterFilePath>\n+ <TargetStatus>\n+ <Error>0</Error>\n+ <ExitCodeStop>0</ExitCodeStop>\n+ <ButtonStop>0</ButtonStop>\n+ <NotGenerated>0</NotGenerated>\n+ <InvalidFlash>1</InvalidFlash>\n+ </TargetStatus>\n+ <OutputDirectory>.\\Objects\\</OutputDirectory>\n+ <OutputName>01bsp_leds</OutputName>\n+ <CreateExecutable>1</CreateExecutable>\n+ <CreateLib>0</CreateLib>\n+ <CreateHexFile>1</CreateHexFile>\n+ <DebugInformation>1</DebugInformation>\n+ <BrowseInformation>1</BrowseInformation>\n+ <ListingPath>.\\Listings\\</ListingPath>\n+ <HexFormatSelection>1</HexFormatSelection>\n+ <Merge32K>0</Merge32K>\n+ <CreateBatchFile>1</CreateBatchFile>\n+ <BeforeCompile>\n+ <RunUserProg1>0</RunUserProg1>\n+ <RunUserProg2>0</RunUserProg2>\n+ <UserProg1Name></UserProg1Name>\n+ <UserProg2Name></UserProg2Name>\n+ <UserProg1Dos16Mode>0</UserProg1Dos16Mode>\n+ <UserProg2Dos16Mode>0</UserProg2Dos16Mode>\n+ <nStopU1X>0</nStopU1X>\n+ <nStopU2X>0</nStopU2X>\n+ </BeforeCompile>\n+ <BeforeMake>\n+ <RunUserProg1>0</RunUserProg1>\n+ <RunUserProg2>0</RunUserProg2>\n+ <UserProg1Name></UserProg1Name>\n+ <UserProg2Name></UserProg2Name>\n+ <UserProg1Dos16Mode>0</UserProg1Dos16Mode>\n+ <UserProg2Dos16Mode>0</UserProg2Dos16Mode>\n+ <nStopB1X>0</nStopB1X>\n+ <nStopB2X>0</nStopB2X>\n+ </BeforeMake>\n+ <AfterMake>\n+ <RunUserProg1>1</RunUserProg1>\n+ <RunUserProg2>1</RunUserProg2>\n+ <UserProg1Name>fromelf --bin .\\Objects\\01bsp_leds.axf -o .\\Objects\\01bsp_leds.bin</UserProg1Name>\n+ <UserProg2Name>fromelf -cvf .\\Objects\\01bsp_leds.axf -o .\\Objects\\disasm.txt</UserProg2Name>\n+ <UserProg1Dos16Mode>0</UserProg1Dos16Mode>\n+ <UserProg2Dos16Mode>0</UserProg2Dos16Mode>\n+ <nStopA1X>0</nStopA1X>\n+ <nStopA2X>0</nStopA2X>\n+ </AfterMake>\n+ <SelectedForBatchBuild>0</SelectedForBatchBuild>\n+ <SVCSIdString></SVCSIdString>\n+ </TargetCommonOption>\n+ <CommonProperty>\n+ <UseCPPCompiler>0</UseCPPCompiler>\n+ <RVCTCodeConst>0</RVCTCodeConst>\n+ <RVCTZI>0</RVCTZI>\n+ <RVCTOtherData>0</RVCTOtherData>\n+ <ModuleSelection>0</ModuleSelection>\n+ <IncludeInBuild>1</IncludeInBuild>\n+ <AlwaysBuild>0</AlwaysBuild>\n+ <GenerateAssemblyFile>0</GenerateAssemblyFile>\n+ <AssembleAssemblyFile>0</AssembleAssemblyFile>\n+ <PublicsOnly>0</PublicsOnly>\n+ <StopOnExitCode>3</StopOnExitCode>\n+ <CustomArgument></CustomArgument>\n+ <IncludeLibraryModules></IncludeLibraryModules>\n+ <ComprImg>1</ComprImg>\n+ </CommonProperty>\n+ <DllOption>\n+ <SimDllName>SARMCM3.DLL</SimDllName>\n+ <SimDllArguments> </SimDllArguments>\n+ <SimDlgDll>DARMCM1.DLL</SimDlgDll>\n+ <SimDlgDllArguments>-pCM0</SimDlgDllArguments>\n+ <TargetDllName>SARMCM3.DLL</TargetDllName>\n+ <TargetDllArguments> </TargetDllArguments>\n+ <TargetDlgDll>TARMCM1.DLL</TargetDlgDll>\n+ <TargetDlgDllArguments>-pCM0</TargetDlgDllArguments>\n+ </DllOption>\n+ <DebugOption>\n+ <OPTHX>\n+ <HexSelection>1</HexSelection>\n+ <HexRangeLowAddress>0</HexRangeLowAddress>\n+ <HexRangeHighAddress>0</HexRangeHighAddress>\n+ <HexOffset>0</HexOffset>\n+ <Oh166RecLen>16</Oh166RecLen>\n+ </OPTHX>\n+ </DebugOption>\n+ <Utilities>\n+ <Flash1>\n+ <UseTargetDll>1</UseTargetDll>\n+ <UseExternalTool>0</UseExternalTool>\n+ <RunIndependent>0</RunIndependent>\n+ <UpdateFlashBeforeDebugging>1</UpdateFlashBeforeDebugging>\n+ <Capability>1</Capability>\n+ <DriverSelection>4096</DriverSelection>\n+ </Flash1>\n+ <bUseTDR>1</bUseTDR>\n+ <Flash2>BIN\\UL2CM3.DLL</Flash2>\n+ <Flash3>\"\" ()</Flash3>\n+ <Flash4></Flash4>\n+ <pFcarmOut></pFcarmOut>\n+ <pFcarmGrp></pFcarmGrp>\n+ <pFcArmRoot></pFcArmRoot>\n+ <FcArmLst>0</FcArmLst>\n+ </Utilities>\n+ <TargetArmAds>\n+ <ArmAdsMisc>\n+ <GenerateListings>0</GenerateListings>\n+ <asHll>1</asHll>\n+ <asAsm>1</asAsm>\n+ <asMacX>1</asMacX>\n+ <asSyms>1</asSyms>\n+ <asFals>1</asFals>\n+ <asDbgD>1</asDbgD>\n+ <asForm>1</asForm>\n+ <ldLst>0</ldLst>\n+ <ldmm>1</ldmm>\n+ <ldXref>1</ldXref>\n+ <BigEnd>0</BigEnd>\n+ <AdsALst>1</AdsALst>\n+ <AdsACrf>1</AdsACrf>\n+ <AdsANop>0</AdsANop>\n+ <AdsANot>0</AdsANot>\n+ <AdsLLst>1</AdsLLst>\n+ <AdsLmap>1</AdsLmap>\n+ <AdsLcgr>1</AdsLcgr>\n+ <AdsLsym>1</AdsLsym>\n+ <AdsLszi>1</AdsLszi>\n+ <AdsLtoi>1</AdsLtoi>\n+ <AdsLsun>1</AdsLsun>\n+ <AdsLven>1</AdsLven>\n+ <AdsLsxf>1</AdsLsxf>\n+ <RvctClst>0</RvctClst>\n+ <GenPPlst>0</GenPPlst>\n+ <AdsCpuType>\"Cortex-M0\"</AdsCpuType>\n+ <RvctDeviceName></RvctDeviceName>\n+ <mOS>0</mOS>\n+ <uocRom>0</uocRom>\n+ <uocRam>0</uocRam>\n+ <hadIROM>1</hadIROM>\n+ <hadIRAM>1</hadIRAM>\n+ <hadXRAM>0</hadXRAM>\n+ <uocXRam>0</uocXRam>\n+ <RvdsVP>0</RvdsVP>\n+ <hadIRAM2>0</hadIRAM2>\n+ <hadIROM2>0</hadIROM2>\n+ <StupSel>8</StupSel>\n+ <useUlib>0</useUlib>\n+ <EndSel>1</EndSel>\n+ <uLtcg>0</uLtcg>\n+ <nSecure>0</nSecure>\n+ <RoSelD>3</RoSelD>\n+ <RwSelD>3</RwSelD>\n+ <CodeSel>0</CodeSel>\n+ <OptFeed>0</OptFeed>\n+ <NoZi1>0</NoZi1>\n+ <NoZi2>0</NoZi2>\n+ <NoZi3>0</NoZi3>\n+ <NoZi4>0</NoZi4>\n+ <NoZi5>0</NoZi5>\n+ <Ro1Chk>0</Ro1Chk>\n+ <Ro2Chk>0</Ro2Chk>\n+ <Ro3Chk>0</Ro3Chk>\n+ <Ir1Chk>1</Ir1Chk>\n+ <Ir2Chk>0</Ir2Chk>\n+ <Ra1Chk>0</Ra1Chk>\n+ <Ra2Chk>0</Ra2Chk>\n+ <Ra3Chk>0</Ra3Chk>\n+ <Im1Chk>1</Im1Chk>\n+ <Im2Chk>0</Im2Chk>\n+ <OnChipMemories>\n+ <Ocm1>\n+ <Type>0</Type>\n+ <StartAddress>0x0</StartAddress>\n+ <Size>0x0</Size>\n+ </Ocm1>\n+ <Ocm2>\n+ <Type>0</Type>\n+ <StartAddress>0x0</StartAddress>\n+ <Size>0x0</Size>\n+ </Ocm2>\n+ <Ocm3>\n+ <Type>0</Type>\n+ <StartAddress>0x0</StartAddress>\n+ <Size>0x0</Size>\n+ </Ocm3>\n+ <Ocm4>\n+ <Type>0</Type>\n+ <StartAddress>0x0</StartAddress>\n+ <Size>0x0</Size>\n+ </Ocm4>\n+ <Ocm5>\n+ <Type>0</Type>\n+ <StartAddress>0x0</StartAddress>\n+ <Size>0x0</Size>\n+ </Ocm5>\n+ <Ocm6>\n+ <Type>0</Type>\n+ <StartAddress>0x0</StartAddress>\n+ <Size>0x0</Size>\n+ </Ocm6>\n+ <IRAM>\n+ <Type>0</Type>\n+ <StartAddress>0x20000000</StartAddress>\n+ <Size>0x20000</Size>\n+ </IRAM>\n+ <IROM>\n+ <Type>1</Type>\n+ <StartAddress>0x0</StartAddress>\n+ <Size>0x40000</Size>\n+ </IROM>\n+ <XRAM>\n+ <Type>0</Type>\n+ <StartAddress>0x0</StartAddress>\n+ <Size>0x0</Size>\n+ </XRAM>\n+ <OCR_RVCT1>\n+ <Type>1</Type>\n+ <StartAddress>0x0</StartAddress>\n+ <Size>0x0</Size>\n+ </OCR_RVCT1>\n+ <OCR_RVCT2>\n+ <Type>1</Type>\n+ <StartAddress>0x0</StartAddress>\n+ <Size>0x0</Size>\n+ </OCR_RVCT2>\n+ <OCR_RVCT3>\n+ <Type>1</Type>\n+ <StartAddress>0x0</StartAddress>\n+ <Size>0x0</Size>\n+ </OCR_RVCT3>\n+ <OCR_RVCT4>\n+ <Type>1</Type>\n+ <StartAddress>0x0</StartAddress>\n+ <Size>0x10000</Size>\n+ </OCR_RVCT4>\n+ <OCR_RVCT5>\n+ <Type>1</Type>\n+ <StartAddress>0x0</StartAddress>\n+ <Size>0x0</Size>\n+ </OCR_RVCT5>\n+ <OCR_RVCT6>\n+ <Type>0</Type>\n+ <StartAddress>0x0</StartAddress>\n+ <Size>0x0</Size>\n+ </OCR_RVCT6>\n+ <OCR_RVCT7>\n+ <Type>0</Type>\n+ <StartAddress>0x0</StartAddress>\n+ <Size>0x0</Size>\n+ </OCR_RVCT7>\n+ <OCR_RVCT8>\n+ <Type>0</Type>\n+ <StartAddress>0x0</StartAddress>\n+ <Size>0x0</Size>\n+ </OCR_RVCT8>\n+ <OCR_RVCT9>\n+ <Type>0</Type>\n+ <StartAddress>0x20000000</StartAddress>\n+ <Size>0x10000</Size>\n+ </OCR_RVCT9>\n+ <OCR_RVCT10>\n+ <Type>0</Type>\n+ <StartAddress>0x0</StartAddress>\n+ <Size>0x0</Size>\n+ </OCR_RVCT10>\n+ </OnChipMemories>\n+ <RvctStartVector></RvctStartVector>\n+ </ArmAdsMisc>\n+ <Cads>\n+ <interw>1</interw>\n+ <Optim>1</Optim>\n+ <oTime>0</oTime>\n+ <SplitLS>0</SplitLS>\n+ <OneElfS>1</OneElfS>\n+ <Strict>0</Strict>\n+ <EnumInt>0</EnumInt>\n+ <PlainCh>0</PlainCh>\n+ <Ropi>0</Ropi>\n+ <Rwpi>0</Rwpi>\n+ <wLevel>2</wLevel>\n+ <uThumb>0</uThumb>\n+ <uSurpInc>0</uSurpInc>\n+ <uC99>0</uC99>\n+ <useXO>0</useXO>\n+ <v6Lang>1</v6Lang>\n+ <v6LangP>1</v6LangP>\n+ <vShortEn>1</vShortEn>\n+ <vShortWch>1</vShortWch>\n+ <v6Lto>0</v6Lto>\n+ <v6WtE>0</v6WtE>\n+ <v6Rtti>0</v6Rtti>\n+ <VariousControls>\n+ <MiscControls></MiscControls>\n+ <Define></Define>\n+ <Undefine></Undefine>\n+ <IncludePath>..\\..\\..\\bsp\\boards;..\\..\\..\\bsp\\boards\\scum</IncludePath>\n+ </VariousControls>\n+ </Cads>\n+ <Aads>\n+ <interw>1</interw>\n+ <Ropi>0</Ropi>\n+ <Rwpi>0</Rwpi>\n+ <thumb>1</thumb>\n+ <SplitLS>0</SplitLS>\n+ <SwStkChk>0</SwStkChk>\n+ <NoWarn>0</NoWarn>\n+ <uSurpInc>0</uSurpInc>\n+ <useXO>0</useXO>\n+ <uClangAs>0</uClangAs>\n+ <VariousControls>\n+ <MiscControls></MiscControls>\n+ <Define></Define>\n+ <Undefine></Undefine>\n+ <IncludePath></IncludePath>\n+ </VariousControls>\n+ </Aads>\n+ <LDads>\n+ <umfTarg>1</umfTarg>\n+ <Ropi>0</Ropi>\n+ <Rwpi>0</Rwpi>\n+ <noStLib>0</noStLib>\n+ <RepFail>1</RepFail>\n+ <useFile>0</useFile>\n+ <TextAddressRange>0x00000000</TextAddressRange>\n+ <DataAddressRange>0x20000000</DataAddressRange>\n+ <pXoBase></pXoBase>\n+ <ScatterFile></ScatterFile>\n+ <IncludeLibs></IncludeLibs>\n+ <IncludeLibsPath></IncludeLibsPath>\n+ <Misc></Misc>\n+ <LinkerInputFile></LinkerInputFile>\n+ <DisabledWarnings></DisabledWarnings>\n+ </LDads>\n+ </TargetArmAds>\n+ </TargetOption>\n+ <Groups>\n+ <Group>\n+ <GroupName>application</GroupName>\n+ <Files>\n+ <File>\n+ <FileName>01bsp_debugpins.c</FileName>\n+ <FileType>1</FileType>\n+ <FilePath>..\\..\\common\\01bsp_debugpins\\01bsp_debugpins.c</FilePath>\n+ </File>\n+ </Files>\n+ </Group>\n+ <Group>\n+ <GroupName>boards</GroupName>\n+ <Files>\n+ <File>\n+ <FileName>board.h</FileName>\n+ <FileType>5</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\board.h</FilePath>\n+ </File>\n+ <File>\n+ <FileName>debugpins.h</FileName>\n+ <FileType>5</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\debugpins.h</FilePath>\n+ </File>\n+ <File>\n+ <FileName>eui64.h</FileName>\n+ <FileType>5</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\eui64.h</FilePath>\n+ </File>\n+ <File>\n+ <FileName>leds.h</FileName>\n+ <FileType>5</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\leds.h</FilePath>\n+ </File>\n+ <File>\n+ <FileName>radio.h</FileName>\n+ <FileType>5</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\radio.h</FilePath>\n+ </File>\n+ <File>\n+ <FileName>uart.h</FileName>\n+ <FileType>5</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\uart.h</FilePath>\n+ </File>\n+ <File>\n+ <FileName>sctimer.h</FileName>\n+ <FileType>5</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\sctimer.h</FilePath>\n+ </File>\n+ </Files>\n+ </Group>\n+ <Group>\n+ <GroupName>scum</GroupName>\n+ <Files>\n+ <File>\n+ <FileName>leds.c</FileName>\n+ <FileType>1</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\leds.c</FilePath>\n+ </File>\n+ <File>\n+ <FileName>memory_map.h</FileName>\n+ <FileType>5</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\memory_map.h</FilePath>\n+ </File>\n+ <File>\n+ <FileName>board_info.h</FileName>\n+ <FileType>5</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\board_info.h</FilePath>\n+ </File>\n+ <File>\n+ <FileName>board.c</FileName>\n+ <FileType>1</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\board.c</FilePath>\n+ </File>\n+ <File>\n+ <FileName>debugpins.c</FileName>\n+ <FileType>1</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\debugpins.c</FilePath>\n+ </File>\n+ <File>\n+ <FileName>eui64.c</FileName>\n+ <FileType>1</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\eui64.c</FilePath>\n+ </File>\n+ <File>\n+ <FileName>radio.c</FileName>\n+ <FileType>1</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\radio.c</FilePath>\n+ </File>\n+ <File>\n+ <FileName>sctimer.c</FileName>\n+ <FileType>1</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\sctimer.c</FilePath>\n+ </File>\n+ <File>\n+ <FileName>uart.c</FileName>\n+ <FileType>1</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\uart.c</FilePath>\n+ </File>\n+ <File>\n+ <FileName>scm3_hardware_interface.c</FileName>\n+ <FileType>1</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\scm3_hardware_interface.c</FilePath>\n+ </File>\n+ <File>\n+ <FileName>scm3_hardware_interface.h</FileName>\n+ <FileType>5</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\scm3_hardware_interface.h</FilePath>\n+ </File>\n+ </Files>\n+ </Group>\n+ <Group>\n+ <GroupName>startUp</GroupName>\n+ <Files>\n+ <File>\n+ <FileName>cm0dsasm.s</FileName>\n+ <FileType>2</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\cm0dsasm.s</FilePath>\n+ </File>\n+ </Files>\n+ </Group>\n+ </Groups>\n+ </Target>\n+ </Targets>\n+\n+ <RTE>\n+ <apis/>\n+ <components/>\n+ <files/>\n+ </RTE>\n+\n+</Project>\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-770. implement debugpins for SCuMv3b.
|
491,595 |
08.08.2018 10:56:22
| 25,200 |
b424ab0cc15d0d9ec75931a364340282194eb7ad
|
update all project files.
|
[
{
"change_type": "MODIFY",
"old_path": "projects/scum/01bsp_leds/01bsp_leds.uvprojx",
"new_path": "projects/scum/01bsp_leds/01bsp_leds.uvprojx",
"diff": "<FileType>1</FileType>\n<FilePath>..\\..\\..\\bsp\\boards\\scum\\uart.c</FilePath>\n</File>\n+ <File>\n+ <FileName>scm3_hardware_interface.c</FileName>\n+ <FileType>1</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\scm3_hardware_interface.c</FilePath>\n+ </File>\n+ <File>\n+ <FileName>scm3_hardware_interface.h</FileName>\n+ <FileType>5</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\scm3_hardware_interface.h</FilePath>\n+ </File>\n</Files>\n</Group>\n<Group>\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/scum/01bsp_multipletimer_radio/01bsp_multipletimer_radio.uvprojx",
"new_path": "projects/scum/01bsp_multipletimer_radio/01bsp_multipletimer_radio.uvprojx",
"diff": "<FileType>1</FileType>\n<FilePath>..\\..\\..\\bsp\\boards\\scum\\uart.c</FilePath>\n</File>\n+ <File>\n+ <FileName>scm3_hardware_interface.c</FileName>\n+ <FileType>1</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\scm3_hardware_interface.c</FilePath>\n+ </File>\n+ <File>\n+ <FileName>scm3_hardware_interface.h</FileName>\n+ <FileType>5</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\scm3_hardware_interface.h</FilePath>\n+ </File>\n</Files>\n</Group>\n</Groups>\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/scum/01bsp_radio/01bsp_radio.uvprojx",
"new_path": "projects/scum/01bsp_radio/01bsp_radio.uvprojx",
"diff": "<FilePath>..\\..\\..\\bsp\\boards\\scum\\sctimer.c</FilePath>\n</File>\n<File>\n- <FileName>retarget.c</FileName>\n+ <FileName>scm3_hardware_interface.c</FileName>\n<FileType>1</FileType>\n- <FilePath>..\\..\\..\\bsp\\boards\\scum\\retarget.c</FilePath>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\scm3_hardware_interface.c</FilePath>\n+ </File>\n+ <File>\n+ <FileName>scm3_hardware_interface.h</FileName>\n+ <FileType>5</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\scm3_hardware_interface.h</FilePath>\n</File>\n</Files>\n</Group>\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/scum/01bsp_sctimer/01bsp_sctimer.uvprojx",
"new_path": "projects/scum/01bsp_sctimer/01bsp_sctimer.uvprojx",
"diff": "<FileType>5</FileType>\n<FilePath>..\\..\\..\\bsp\\boards\\scum\\memory_map.h</FilePath>\n</File>\n+ <File>\n+ <FileName>scm3_hardware_interface.c</FileName>\n+ <FileType>1</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\scm3_hardware_interface.c</FilePath>\n+ </File>\n+ <File>\n+ <FileName>scm3_hardware_interface.h</FileName>\n+ <FileType>5</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\scm3_hardware_interface.h</FilePath>\n+ </File>\n</Files>\n</Group>\n</Groups>\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/scum/01bsp_uart/01bsp_uart.uvprojx",
"new_path": "projects/scum/01bsp_uart/01bsp_uart.uvprojx",
"diff": "<FilePath>..\\..\\..\\bsp\\boards\\scum\\debugpins.c</FilePath>\n</File>\n<File>\n- <FileName>retarget.c</FileName>\n+ <FileName>scm3_hardware_interface.c</FileName>\n<FileType>1</FileType>\n- <FilePath>..\\..\\..\\bsp\\boards\\scum\\retarget.c</FilePath>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\scm3_hardware_interface.c</FilePath>\n+ </File>\n+ <File>\n+ <FileName>scm3_hardware_interface.h</FileName>\n+ <FileType>5</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\scm3_hardware_interface.h</FilePath>\n</File>\n</Files>\n</Group>\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/scum/02drv_openserial/02drv_openserial.uvprojx",
"new_path": "projects/scum/02drv_openserial/02drv_openserial.uvprojx",
"diff": "<FileType>1</FileType>\n<FilePath>..\\..\\..\\bsp\\boards\\scum\\eui64.c</FilePath>\n</File>\n+ <File>\n+ <FileName>scm3_hardware_interface.c</FileName>\n+ <FileType>1</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\scm3_hardware_interface.c</FilePath>\n+ </File>\n+ <File>\n+ <FileName>scm3_hardware_interface.h</FileName>\n+ <FileType>5</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\scm3_hardware_interface.h</FilePath>\n+ </File>\n</Files>\n</Group>\n<Group>\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/scum/02drv_opentimers/02drv_opentimers.uvprojx",
"new_path": "projects/scum/02drv_opentimers/02drv_opentimers.uvprojx",
"diff": "<FileType>1</FileType>\n<FilePath>..\\..\\..\\bsp\\boards\\scum\\sctimer.c</FilePath>\n</File>\n+ <File>\n+ <FileName>scm3_hardware_interface.c</FileName>\n+ <FileType>1</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\scm3_hardware_interface.c</FilePath>\n+ </File>\n+ <File>\n+ <FileName>scm3_hardware_interface.h</FileName>\n+ <FileType>5</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\scm3_hardware_interface.h</FilePath>\n+ </File>\n</Files>\n</Group>\n<Group>\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/scum/03oos_macpong/03oos_macpong.uvprojx",
"new_path": "projects/scum/03oos_macpong/03oos_macpong.uvprojx",
"diff": "<FileType>1</FileType>\n<FilePath>..\\..\\..\\bsp\\boards\\scum\\sctimer.c</FilePath>\n</File>\n+ <File>\n+ <FileName>scm3_hardware_interface.c</FileName>\n+ <FileType>1</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\scm3_hardware_interface.c</FilePath>\n+ </File>\n+ <File>\n+ <FileName>scm3_hardware_interface.h</FileName>\n+ <FileType>5</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\scm3_hardware_interface.h</FilePath>\n+ </File>\n</Files>\n</Group>\n<Group>\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/scum/03oos_openwsn/03oos_openwsn.uvprojx",
"new_path": "projects/scum/03oos_openwsn/03oos_openwsn.uvprojx",
"diff": "<TargetName>Target SCuM</TargetName>\n<ToolsetNumber>0x4</ToolsetNumber>\n<ToolsetName>ARM-ADS</ToolsetName>\n- <pCCUsed>5060183::V5.06 update 2 (build 183)::ARMCC</pCCUsed>\n+ <pCCUsed>5060528::V5.06 update 5 (build 528)::ARMCC</pCCUsed>\n+ <uAC6>0</uAC6>\n<TargetOption>\n<TargetCommonOption>\n<Device>ARMCM0</Device>\n<Vendor>ARM</Vendor>\n- <PackID>ARM.CMSIS.4.5.0</PackID>\n+ <PackID>ARM.CMSIS.5.0.1</PackID>\n<PackURL>http://www.keil.com/pack/</PackURL>\n<Cpu>IRAM(0x20000000,0x20000) IROM(0x00000000,0x40000) CPUTYPE(\"Cortex-M0\") CLOCK(12000000) ESEL ELITTLE</Cpu>\n<FlashUtilSpec></FlashUtilSpec>\n<vShortWch>1</vShortWch>\n<v6Lto>0</v6Lto>\n<v6WtE>0</v6WtE>\n+ <v6Rtti>0</v6Rtti>\n<VariousControls>\n<MiscControls>--gnu</MiscControls>\n<Define></Define>\n<Undefine></Undefine>\n- <IncludePath>..\\..\\..\\bsp\\boards;..\\..\\..\\bsp\\boards\\scum;..\\..\\..\\drivers\\common;..\\..\\..\\inc;..\\..\\..\\openstack\\02a-MAClow;..\\..\\..\\openstack\\02b-MAChigh;..\\..\\..\\openstack\\03a-IPHC;..\\..\\..\\openstack\\03b-IPv6;..\\..\\..\\openstack\\04-TRAN;..\\..\\..\\openstack\\cross-layers;..\\..\\..\\kernel;..\\..\\..\\openapps;..\\..\\..\\openstack;..\\..\\..\\bsp\\boards\\common;..\\..\\..\\openapps\\c6t;..\\..\\..\\openapps\\uinject;..\\..\\..\\openapps\\techo;..\\..\\..\\openapps\\uecho;..\\..\\..\\openapps\\cinfo;..\\..\\..\\openapps\\cleds;..\\..\\..\\openapps\\rrt;..\\..\\..\\openapps\\cexample;..\\..\\..\\openapps\\cstorm;..\\..\\..\\openapps\\cwellknown;..\\..\\..\\openapps\\userialbridge</IncludePath>\n+ <IncludePath>..\\..\\..\\bsp\\boards;..\\..\\..\\bsp\\boards\\scum;..\\..\\..\\drivers\\common;..\\..\\..\\inc;..\\..\\..\\openstack\\02a-MAClow;..\\..\\..\\openstack\\02b-MAChigh;..\\..\\..\\openstack\\03a-IPHC;..\\..\\..\\openstack\\03b-IPv6;..\\..\\..\\openstack\\04-TRAN;..\\..\\..\\openstack\\cross-layers;..\\..\\..\\kernel;..\\..\\..\\openapps;..\\..\\..\\openstack;..\\..\\..\\bsp\\boards\\common;..\\..\\..\\openapps\\c6t;..\\..\\..\\openapps\\uinject;..\\..\\..\\openapps\\techo;..\\..\\..\\openapps\\uecho;..\\..\\..\\openapps\\cinfo;..\\..\\..\\openapps\\cleds;..\\..\\..\\openapps\\rrt;..\\..\\..\\openapps\\cexample;..\\..\\..\\openapps\\cstorm;..\\..\\..\\openapps\\cwellknown;..\\..\\..\\openapps\\userialbridge;..\\..\\..\\openapps\\opencoap;..\\..\\..\\openapps\\cjoin;..\\..\\..\\openapps\\uexpiration;..\\..\\..\\openapps\\uexpiration_monitor</IncludePath>\n</VariousControls>\n</Cads>\n<Aads>\n<NoWarn>0</NoWarn>\n<uSurpInc>0</uSurpInc>\n<useXO>0</useXO>\n+ <uClangAs>0</uClangAs>\n<VariousControls>\n<MiscControls></MiscControls>\n<Define></Define>\n<FileType>5</FileType>\n<FilePath>..\\..\\..\\bsp\\boards\\radio.h</FilePath>\n</File>\n- <File>\n- <FileName>radiotimer.h</FileName>\n- <FileType>5</FileType>\n- <FilePath>..\\..\\..\\bsp\\boards\\radiotimer.h</FilePath>\n- </File>\n<File>\n<FileName>uart.h</FileName>\n<FileType>5</FileType>\n<FilePath>..\\..\\..\\bsp\\boards\\uart.h</FilePath>\n</File>\n<File>\n- <FileName>bsp_timer.h</FileName>\n+ <FileName>sctimer.h</FileName>\n<FileType>5</FileType>\n- <FilePath>..\\..\\..\\bsp\\boards\\bsp_timer.h</FilePath>\n+ <FilePath>..\\..\\..\\bsp\\boards\\sctimer.h</FilePath>\n</File>\n</Files>\n</Group>\n<FileType>1</FileType>\n<FilePath>..\\..\\..\\bsp\\boards\\scum\\uart.c</FilePath>\n</File>\n- <File>\n- <FileName>bsp_timer.c</FileName>\n- <FileType>1</FileType>\n- <FilePath>..\\..\\..\\bsp\\boards\\scum\\bsp_timer.c</FilePath>\n- </File>\n- <File>\n- <FileName>radiotimer.c</FileName>\n- <FileType>1</FileType>\n- <FilePath>..\\..\\..\\bsp\\boards\\scum\\radiotimer.c</FilePath>\n- </File>\n<File>\n<FileName>debugpins.c</FileName>\n<FileType>1</FileType>\n<FilePath>..\\..\\..\\bsp\\boards\\scum\\eui64.c</FilePath>\n</File>\n<File>\n- <FileName>dummy_crypto_engine.c</FileName>\n+ <FileName>scm3_hardware_interface.c</FileName>\n+ <FileType>1</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\scm3_hardware_interface.c</FilePath>\n+ </File>\n+ <File>\n+ <FileName>scm3_hardware_interface.h</FileName>\n+ <FileType>5</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\scm3_hardware_interface.h</FilePath>\n+ </File>\n+ <File>\n+ <FileName>sctimer.c</FileName>\n<FileType>1</FileType>\n- <FilePath>..\\..\\..\\bsp\\boards\\common\\dummy_crypto_engine.c</FilePath>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\sctimer.c</FilePath>\n+ </File>\n+ <File>\n+ <FileName>cryptoengine.c</FileName>\n+ <FileType>1</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\cryptoengine.c</FilePath>\n</File>\n</Files>\n</Group>\n<Group>\n<GroupName>02a-MAClow</GroupName>\n<Files>\n- <File>\n- <FileName>adaptive_sync.c</FileName>\n- <FileType>1</FileType>\n- <FilePath>..\\..\\..\\openstack\\02a-MAClow\\adaptive_sync.c</FilePath>\n- </File>\n<File>\n<FileName>IEEE802154.c</FileName>\n<FileType>1</FileType>\n<FilePath>..\\..\\..\\openstack\\02a-MAClow\\IEEE802154.c</FilePath>\n</File>\n- <File>\n- <FileName>IEEE802154_dummy_security.c</FileName>\n- <FileType>1</FileType>\n- <FilePath>..\\..\\..\\openstack\\02a-MAClow\\IEEE802154_dummy_security.c</FilePath>\n- </File>\n<File>\n<FileName>IEEE802154_security.c</FileName>\n<FileType>1</FileType>\n<FileType>1</FileType>\n<FilePath>..\\..\\..\\openstack\\02b-MAChigh\\neighbors.c</FilePath>\n</File>\n- <File>\n- <FileName>processIE.c</FileName>\n- <FileType>1</FileType>\n- <FilePath>..\\..\\..\\openstack\\02b-MAChigh\\processIE.c</FilePath>\n- </File>\n<File>\n<FileName>schedule.c</FileName>\n<FileType>1</FileType>\n<Group>\n<GroupName>04-TRAN</GroupName>\n<Files>\n- <File>\n- <FileName>opencoap.c</FileName>\n- <FileType>1</FileType>\n- <FilePath>..\\..\\..\\openstack\\04-TRAN\\opencoap.c</FilePath>\n- </File>\n- <File>\n- <FileName>opentcp.c</FileName>\n- <FileType>1</FileType>\n- <FilePath>..\\..\\..\\openstack\\04-TRAN\\opentcp.c</FilePath>\n- </File>\n<File>\n<FileName>openudp.c</FileName>\n<FileType>1</FileType>\n</File>\n</Files>\n</Group>\n- <Group>\n- <GroupName>techo</GroupName>\n- <Files>\n- <File>\n- <FileName>techo.c</FileName>\n- <FileType>1</FileType>\n- <FilePath>..\\..\\..\\openapps\\techo\\techo.c</FilePath>\n- </File>\n- </Files>\n- </Group>\n<Group>\n<GroupName>uinject</GroupName>\n<Files>\n</File>\n</Files>\n</Group>\n+ <Group>\n+ <GroupName>opencoap</GroupName>\n+ <Files>\n+ <File>\n+ <FileName>cborencoder.c</FileName>\n+ <FileType>1</FileType>\n+ <FilePath>..\\..\\..\\openapps\\opencoap\\cborencoder.c</FilePath>\n+ </File>\n+ <File>\n+ <FileName>cborencoder.h</FileName>\n+ <FileType>5</FileType>\n+ <FilePath>..\\..\\..\\openapps\\opencoap\\cborencoder.h</FilePath>\n+ </File>\n+ <File>\n+ <FileName>hkdf.c</FileName>\n+ <FileType>1</FileType>\n+ <FilePath>..\\..\\..\\openapps\\opencoap\\hkdf.c</FilePath>\n+ </File>\n+ <File>\n+ <FileName>hmac.c</FileName>\n+ <FileType>1</FileType>\n+ <FilePath>..\\..\\..\\openapps\\opencoap\\hmac.c</FilePath>\n+ </File>\n+ <File>\n+ <FileName>opencoap.c</FileName>\n+ <FileType>1</FileType>\n+ <FilePath>..\\..\\..\\openapps\\opencoap\\opencoap.c</FilePath>\n+ </File>\n+ <File>\n+ <FileName>opencoap.h</FileName>\n+ <FileType>5</FileType>\n+ <FilePath>..\\..\\..\\openapps\\opencoap\\opencoap.h</FilePath>\n+ </File>\n+ <File>\n+ <FileName>openoscoap.c</FileName>\n+ <FileType>1</FileType>\n+ <FilePath>..\\..\\..\\openapps\\opencoap\\openoscoap.c</FilePath>\n+ </File>\n+ <File>\n+ <FileName>openoscoap.h</FileName>\n+ <FileType>5</FileType>\n+ <FilePath>..\\..\\..\\openapps\\opencoap\\openoscoap.h</FilePath>\n+ </File>\n+ <File>\n+ <FileName>sha.h</FileName>\n+ <FileType>5</FileType>\n+ <FilePath>..\\..\\..\\openapps\\opencoap\\sha.h</FilePath>\n+ </File>\n+ <File>\n+ <FileName>sha224-256.c</FileName>\n+ <FileType>1</FileType>\n+ <FilePath>..\\..\\..\\openapps\\opencoap\\sha224-256.c</FilePath>\n+ </File>\n+ <File>\n+ <FileName>sha-private.h</FileName>\n+ <FileType>5</FileType>\n+ <FilePath>..\\..\\..\\openapps\\opencoap\\sha-private.h</FilePath>\n+ </File>\n+ <File>\n+ <FileName>usha.c</FileName>\n+ <FileType>1</FileType>\n+ <FilePath>..\\..\\..\\openapps\\opencoap\\usha.c</FilePath>\n+ </File>\n+ </Files>\n+ </Group>\n+ <Group>\n+ <GroupName>uexpiration</GroupName>\n+ <Files>\n+ <File>\n+ <FileName>uexpiration.c</FileName>\n+ <FileType>1</FileType>\n+ <FilePath>..\\..\\..\\openapps\\uexpiration\\uexpiration.c</FilePath>\n+ </File>\n+ <File>\n+ <FileName>uexpiration.h</FileName>\n+ <FileType>5</FileType>\n+ <FilePath>..\\..\\..\\openapps\\uexpiration\\uexpiration.h</FilePath>\n+ </File>\n+ </Files>\n+ </Group>\n+ <Group>\n+ <GroupName>uexpiration_monitor</GroupName>\n+ <Files>\n+ <File>\n+ <FileName>uexpiration_monitor.c</FileName>\n+ <FileType>1</FileType>\n+ <FilePath>..\\..\\..\\openapps\\uexpiration_monitor\\uexpiration_monitor.c</FilePath>\n+ </File>\n+ <File>\n+ <FileName>uexpiration_monitor.h</FileName>\n+ <FileType>5</FileType>\n+ <FilePath>..\\..\\..\\openapps\\uexpiration_monitor\\uexpiration_monitor.h</FilePath>\n+ </File>\n+ </Files>\n+ </Group>\n+ <Group>\n+ <GroupName>cjoin</GroupName>\n+ <Files>\n+ <File>\n+ <FileName>cjoin.c</FileName>\n+ <FileType>1</FileType>\n+ <FilePath>..\\..\\..\\openapps\\cjoin\\cjoin.c</FilePath>\n+ </File>\n+ <File>\n+ <FileName>cjoin.h</FileName>\n+ <FileType>5</FileType>\n+ <FilePath>..\\..\\..\\openapps\\cjoin\\cjoin.h</FilePath>\n+ </File>\n+ <File>\n+ <FileName>cojp_cbor.c</FileName>\n+ <FileType>1</FileType>\n+ <FilePath>..\\..\\..\\openapps\\cjoin\\cojp_cbor.c</FilePath>\n+ </File>\n+ <File>\n+ <FileName>cojp_cbor.h</FileName>\n+ <FileType>5</FileType>\n+ <FilePath>..\\..\\..\\openapps\\cjoin\\cojp_cbor.h</FilePath>\n+ </File>\n+ </Files>\n+ </Group>\n</Groups>\n</Target>\n</Targets>\n+ <RTE>\n+ <apis/>\n+ <components/>\n+ <files/>\n+ </RTE>\n+\n</Project>\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-770. update all project files.
|
491,595 |
12.08.2018 19:45:46
| 25,200 |
f1942111ea475685ba66524cfb9ce3d16293c5c2
|
update the ASC file as is fixed.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/scum/scm3_hardware_interface.c",
"new_path": "bsp/boards/scum/scm3_hardware_interface.c",
"diff": "@@ -556,6 +556,8 @@ void compute_2M_rolling_average() {\nvoid initialize_ASC(){\n+ // The meaning of each bit is explained in scm3_ASC_v9.m script\n+\nASC[0] = 0xC0000000; //0-31\nASC[1] = 0x00000000; //32-63\nASC[2] = 0x00000000; //64-95\n@@ -563,8 +565,8 @@ void initialize_ASC(){\nASC[4] = 0x00000000; //128-159\nASC[5] = 0x00000000; //160-191\nASC[6] = 0x00000000; //192-223\n- ASC[7] = 0x00000099; //224-255\n- ASC[8] = 0x91C3FFFF; //256-287\n+ ASC[7] = 0x00000033; //224-255\n+ ASC[8] = 0x2207FFFF; //256-287\nASC[9] = 0xE0C66388; //288-319\nASC[10] = 0x88040020; //320-351\nASC[11] = 0x000C0000; //352-383\n@@ -581,7 +583,7 @@ void initialize_ASC(){\nASC[22] = 0x2FFFFC00; //704-735\nASC[23] = 0x20000000; //736-767\nASC[24] = 0x00007CFC; //768-799\n- ASC[25] = 0x10000018; //800-831\n+ ASC[25] = 0x20000018; //800-831\nASC[26] = 0x02800000; //832-863\nASC[27] = 0x00000000; //864-895\nASC[28] = 0x00000000; //896-927\n@@ -591,53 +593,11 @@ void initialize_ASC(){\nASC[32] = 0x80000012; //1024-1055\nASC[33] = 0xC004B000; //1056-1087\nASC[34] = 0x7C000015; //1088-1119 enable GPIO\n- //ASC[35] = 0x4AB54AA0; //1120-1151\nASC[35] = 0x4AAAAAA0; //GPIO 0- 3 in\nASC[36] = 0x00000000; //1152-1183\nASC[37] = 0x00000000;\n- /*\n-ASC[0] = 0xFF8002FF; //0-31\n-ASC[1] = 0xFFE03020; //32-63\n-ASC[2] = 0x20202000; //64-95\n-ASC[3] = 0x00160006; //96-127\n-ASC[4] = 0x48000000; //128-159\n-ASC[5] = 0x00000000; //160-191\n-ASC[6] = 0x00003000; //192-223\n-ASC[7] = 0x00034099; //224-255\n-ASC[8] = 0x9900FFFF; //256-287\n-ASC[9] = 0xE0423100; //288-319\n-ASC[10] = 0x000A0060; //320-351\n-ASC[11] = 0x000C0912; //352-383\n-ASC[12] = 0x4A7F9F06; //384-415\n-ASC[13] = 0x076082C4; //416-447\n-ASC[14] = 0x607D0007; //448-479\n-ASC[15] = 0xFFE00B01; //480-511\n-ASC[16] = 0xCFFFFF00; //512-543\n-ASC[17] = 0x22300080; //544-575\n-ASC[18] = 0x010205F9; //576-607\n-ASC[19] = 0x0506E7E8; //608-639\n-ASC[20] = 0x10200040; //640-671\n-ASC[21] = 0x03111810; //672-703\n-ASC[22] = 0x2FFFFC00; //704-735\n-ASC[23] = 0x20000000; //736-767\n-ASC[24] = 0x00007CFC; //768-799\n-ASC[25] = 0x20000018; //800-831\n-ASC[26] = 0x02800000; //832-863\n-ASC[27] = 0x00000000; //864-895\n-ASC[28] = 0x00000808; //896-927\n-ASC[29] = 0x00780072; //928-959\n-ASC[30] = 0xA0100007; //960-991\n-ASC[31] = 0xF7000804; //992-1023\n-ASC[32] = 0xE0603C7F; //1024-1055\n-ASC[33] = 0x09E4B084; //1056-1087\n-ASC[34] = 0x7FE379B5; //1088-1119\n-ASC[35] = 0x4AAAAAA0; //1120-1151\n-ASC[36] = 0x00000000; //1152-1183\n-ASC[37] = 0x00000000;\n-*/\n-\nanalog_scan_chain_write(&ASC[0]);\nanalog_scan_chain_load();\n}\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-770. update the ASC file as SCUM-88 is fixed.
|
491,595 |
12.08.2018 19:46:34
| 25,200 |
ce89cf828ed75edefc12c75310fa63ec24c06d91
|
configure priority of interrupts.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/scum/board.c",
"new_path": "bsp/boards/scum/board.c",
"diff": "@@ -35,6 +35,10 @@ void board_init(void) {\n// initialize the scan chain\ninitialize_ASC();\n+ IPR0 = 0xFF; // uart has lowest priority\n+ IPR6 = 0x0F; // priority for radio\n+ IPR7 = 0x00; // priority for rf_timer\n+\n// initialize bsp modules\ndebugpins_init();\nleds_init();\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/scum/memory_map.h",
"new_path": "bsp/boards/scum/memory_map.h",
"diff": "#define GPIO_REG__INPUT *(unsigned int*)(APB_GPIO_BASE + 0x000000)\n#define GPIO_REG__OUTPUT *(unsigned int*)(APB_GPIO_BASE + 0x040000)\n-// ========================== Analog Configure Registers\n+// ========================== Analog Configure Registers ======================\n#define ANALOG_CFG_REG__0 *(unsigned int*)(APB_ANALOG_CFG_BASE + 0x000000)\n#define ANALOG_CFG_REG__22 *(unsigned int*)(APB_ANALOG_CFG_BASE + 0x580000)\n#define ISER *(unsigned int*)(0xE000E100)\n#define ICER *(unsigned int*)(0xE000E180)\n+\n+// =========================== Priority Registers =============================\n+\n+#define IPR0 *(unsigned int*)( 0xE000E400 )\n+#define IPR6 *(unsigned int*)( 0xE000E418 )\n+#define IPR7 *(unsigned int*)( 0xE000E41C )\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-770. configure priority of interrupts.
|
491,595 |
12.08.2018 19:47:50
| 25,200 |
14234fa0cdb5c578c70dbbc3a7f97bb45df6f3fb
|
update bsp_multipletimer_radio project.c
|
[
{
"change_type": "MODIFY",
"old_path": "projects/scum/01bsp_multipletimer_radio/01bsp_multipletimer_radio.c",
"new_path": "projects/scum/01bsp_multipletimer_radio/01bsp_multipletimer_radio.c",
"diff": "@@ -77,6 +77,8 @@ typedef struct {\nuint8_t rxpk_lqi;\nbool rxpk_crc;\nuint32_t startOfSlotReference;\n+ uint8_t debug[10];\n+ uint8_t debug_index;\n} app_vars_t;\napp_vars_t app_vars;\n@@ -127,7 +129,7 @@ int mote_main(void) {\n// send dummy text\nuart_writeByte('*');\n// reduce the usage of UART\n-// for (i=0;i<0xff;i++);\n+ for (i=0;i<0xff;i++);\n}\n}\n@@ -145,6 +147,7 @@ void cb_endFrame(PORT_TIMER_WIDTH timestamp) {\nvoid cb_timer(void) {\n+ uint8_t i;\ndebugpins_slot_toggle();\napp_vars.startOfSlotReference = sctimer_readCounter();\n@@ -156,11 +159,19 @@ void cb_timer(void) {\n}\ndebugpins_fsm_clr();\n+ for (i=0;i<10;i++){\n+ uart_writeByte(app_vars.debug[i]);\n+ }\n+\n+ memset(&app_vars.debug[0],0,10);\n+ app_vars.debug[8] = '\\r';\n+ app_vars.debug[9] = '\\n';\n+\n+ app_vars.debug_index = 0;\n// time slot starts, use the register here\n- uart_writeByte('S');\n- uart_writeByte('S');\n+ app_vars.debug[app_vars.debug_index++] = 'S';\n// change {0-9} to char\n- uart_writeByte(0x30 + app_vars.state);\n+ app_vars.debug[app_vars.debug_index++] = 0x30 + app_vars.state;\napp_vars.state = APP_STATE_RXDATAOFFSET;\n@@ -172,10 +183,10 @@ void cb_timer(void) {\nvoid cb_action_timer(void){\n- // change the state\n- uart_writeByte('C');\n- uart_writeByte('S');\n- uart_writeByte(0x30 + app_vars.state);\n+ // time slot starts, use the register here\n+ app_vars.debug[app_vars.debug_index++] = 'C';\n+ // change {0-9} to char\n+ app_vars.debug[app_vars.debug_index++] = 0x30 + app_vars.state;\ndebugpins_fsm_toggle();\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-770. update bsp_multipletimer_radio project.c
|
491,595 |
12.08.2018 19:54:37
| 25,200 |
338efe6aab2b30f0754ddd6a61b37afbd3d570ee
|
update the time converting as the system clock is changed from 500K to 2.5MHz.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/scum/board_info.h",
"new_path": "bsp/boards/scum/board_info.h",
"diff": "@@ -38,12 +38,19 @@ to return the board's description.\n* two different frequency clocks. 500000/32768 is approximately 61/4.\n**/\n+// with the setup of FPGA board +teensy, the sys clock is 2.5MHz, so the\n+// following time converting is between 32KHz and 2.5MHz\n+\n// this is called when require to WRITE the RFTIMER counter/compare registers,\n// where the value is going to be multiplied.\n-#define TIMER_COUNTER_CONVERT_32K_TO_500K(value) value*61/4\n+#define TIMER_COUNTER_CONVERT_32K_TO_SYS_CLK(value) value*305/4\n// this is called when require to READ the RFTIMER counter/compare registers,\n// where the value is going to be divided.\n-#define TIMER_COUNTER_CONVERT_500K_TO_32K(value) value*4/61\n+#define TIMER_COUNTER_CONVERT_SYS_CLK_TO_32K(value) value*4/305\n+\n+/**\n+* End\n+**/\n//===== radio\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/scum/radio.c",
"new_path": "bsp/boards/scum/radio.c",
"diff": "@@ -264,7 +264,7 @@ kick_scheduler_t radio_isr(void) {\nif (irq_status & TX_SFD_DONE_INT) {\n#ifdef SLOT_FSM_IMPLEMENTATION_MULTIPLE_TIMER_INTERRUPT\n// get the capture Time from capture register\n- capturedTime = TIMER_COUNTER_CONVERT_500K_TO_32K(RFTIMER_REG__CAPTURE0);\n+ capturedTime = TIMER_COUNTER_CONVERT_SYS_CLK_TO_32K(RFTIMER_REG__CAPTURE0);\n#endif\nRFCONTROLLER_REG__INT_CLEAR = TX_SFD_DONE_INT;\n// a SFD is just sent, update radio state\n@@ -273,7 +273,7 @@ kick_scheduler_t radio_isr(void) {\nif (irq_status & RX_SFD_DONE_INT) {\n#ifdef SLOT_FSM_IMPLEMENTATION_MULTIPLE_TIMER_INTERRUPT\n// get the capture Time from capture register\n- capturedTime = TIMER_COUNTER_CONVERT_500K_TO_32K(RFTIMER_REG__CAPTURE1);\n+ capturedTime = TIMER_COUNTER_CONVERT_SYS_CLK_TO_32K(RFTIMER_REG__CAPTURE1);\n#endif\nRFCONTROLLER_REG__INT_CLEAR = RX_SFD_DONE_INT;\n// a SFD is just received, update radio state\n@@ -292,14 +292,14 @@ kick_scheduler_t radio_isr(void) {\nif (irq_status & TX_SEND_DONE_INT) {\n#ifdef SLOT_FSM_IMPLEMENTATION_MULTIPLE_TIMER_INTERRUPT\n// get the capture Time from capture register\n- capturedTime = TIMER_COUNTER_CONVERT_500K_TO_32K(RFTIMER_REG__CAPTURE2);\n+ capturedTime = TIMER_COUNTER_CONVERT_SYS_CLK_TO_32K(RFTIMER_REG__CAPTURE2);\n#endif\nRFCONTROLLER_REG__INT_CLEAR = TX_SEND_DONE_INT;\n}\nif (irq_status & RX_DONE_INT) {\n#ifdef SLOT_FSM_IMPLEMENTATION_MULTIPLE_TIMER_INTERRUPT\n// get the capture Time from capture register\n- capturedTime = TIMER_COUNTER_CONVERT_500K_TO_32K(RFTIMER_REG__CAPTURE3);\n+ capturedTime = TIMER_COUNTER_CONVERT_SYS_CLK_TO_32K(RFTIMER_REG__CAPTURE3);\n#endif\nRFCONTROLLER_REG__INT_CLEAR = RX_DONE_INT;\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/scum/sctimer.c",
"new_path": "bsp/boards/scum/sctimer.c",
"diff": "@@ -58,7 +58,7 @@ void sctimer_setCompare(PORT_TIMER_WIDTH val){\nPORT_TIMER_WIDTH currentTime;\n- currentTime = TIMER_COUNTER_CONVERT_500K_TO_32K(RFTIMER_REG__COUNTER);\n+ currentTime = TIMER_COUNTER_CONVERT_SYS_CLK_TO_32K(RFTIMER_REG__COUNTER);\nsctimer_enable();\nif (currentTime - val < TIMERLOOP_THRESHOLD){\n@@ -75,7 +75,7 @@ void sctimer_setCompare(PORT_TIMER_WIDTH val){\n} else {\n// mark clear the flag here\n// schedule the timer at val\n- RFTIMER_REG__COMPARE0 = (PORT_TIMER_WIDTH)(TIMER_COUNTER_CONVERT_32K_TO_500K(val) & RFTIMER_MAX_COUNT);\n+ RFTIMER_REG__COMPARE0 = (PORT_TIMER_WIDTH)(TIMER_COUNTER_CONVERT_32K_TO_SYS_CLK(val) & RFTIMER_MAX_COUNT);\nRFTIMER_REG__COMPARE0_CONTROL = RFTIMER_COMPARE_ENABLE | \\\nRFTIMER_COMPARE_INTERRUPT_ENABLE;\n}\n@@ -88,7 +88,7 @@ void sctimer_setCompare(PORT_TIMER_WIDTH val){\n\\returns The current value of the timer's counter.\n*/\nPORT_TIMER_WIDTH sctimer_readCounter(void){\n- return TIMER_COUNTER_CONVERT_500K_TO_32K(RFTIMER_REG__COUNTER);\n+ return TIMER_COUNTER_CONVERT_SYS_CLK_TO_32K(RFTIMER_REG__COUNTER);\n}\nvoid sctimer_enable(void){\n@@ -111,7 +111,7 @@ void sctimer_scheduleActionIn(uint8_t type,PORT_RADIOTIMER_WIDTH offset){\nswitch(type){\ncase ACTION_LOAD_PACKET:\n// offset when to fire\n- RFTIMER_REG__COMPARE3 = TIMER_COUNTER_CONVERT_32K_TO_500K(offset);\n+ RFTIMER_REG__COMPARE3 = TIMER_COUNTER_CONVERT_32K_TO_SYS_CLK(offset);\n// enable compare and tx load interrupt (this also cancels any pending interrupts)\nRFTIMER_REG__COMPARE3_CONTROL = RFTIMER_COMPARE_ENABLE |\\\n@@ -120,7 +120,7 @@ void sctimer_scheduleActionIn(uint8_t type,PORT_RADIOTIMER_WIDTH offset){\nbreak;\ncase ACTION_SEND_PACKET:\n// offset when to fire\n- RFTIMER_REG__COMPARE4 = TIMER_COUNTER_CONVERT_32K_TO_500K(offset);\n+ RFTIMER_REG__COMPARE4 = TIMER_COUNTER_CONVERT_32K_TO_SYS_CLK(offset);\n// enable compare and tx send interrupt (this also cancels any pending interrupts)\nRFTIMER_REG__COMPARE4_CONTROL = RFTIMER_COMPARE_ENABLE |\\\n@@ -129,7 +129,7 @@ void sctimer_scheduleActionIn(uint8_t type,PORT_RADIOTIMER_WIDTH offset){\nbreak;\ncase ACTION_RADIORX_ENABLE:\n// offset when to fire\n- RFTIMER_REG__COMPARE5 = TIMER_COUNTER_CONVERT_32K_TO_500K(offset);\n+ RFTIMER_REG__COMPARE5 = TIMER_COUNTER_CONVERT_32K_TO_SYS_CLK(offset);\n// enable compare and rx start interrupt (this also cancels any pending interrupts)\nRFTIMER_REG__COMPARE5_CONTROL = RFTIMER_COMPARE_ENABLE |\\\n@@ -138,7 +138,7 @@ void sctimer_scheduleActionIn(uint8_t type,PORT_RADIOTIMER_WIDTH offset){\nbreak;\ncase ACTION_SET_TIMEOUT:\n// offset when to fire\n- RFTIMER_REG__COMPARE2 = TIMER_COUNTER_CONVERT_32K_TO_500K(offset);\n+ RFTIMER_REG__COMPARE2 = TIMER_COUNTER_CONVERT_32K_TO_SYS_CLK(offset);\n// enable compare interrupt (this also cancels any pending interrupts)\nRFTIMER_REG__COMPARE2_CONTROL = RFTIMER_COMPARE_ENABLE |\\\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-770. update the time converting as the system clock is changed from 500K to 2.5MHz.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.