File tree Expand file tree Collapse file tree 2 files changed +38
-2
lines changed
hal/targets/hal/TARGET_NORDIC/TARGET_NRF5 Expand file tree Collapse file tree 2 files changed +38
-2
lines changed Original file line number Diff line number Diff line change @@ -60,7 +60,14 @@ uint16_t analogin_read_u16(analogin_t *obj)
60
60
{
61
61
nrf_adc_value_t adc_value ;
62
62
63
- nrf_drv_adc_channel_t adc_channel = NRF_DRV_ADC_DEFAULT_CHANNEL (obj -> adc_pin );
63
+ nrf_drv_adc_channel_t adc_channel ;
64
+
65
+
66
+ adc_channel .config .config .resolution = NRF_ADC_CONFIG_RES_10BIT ;
67
+ adc_channel .config .config .input = NRF_ADC_CONFIG_SCALING_INPUT_FULL_SCALE ;
68
+ adc_channel .config .config .reference = NRF_ADC_CONFIG_REF_VBG ;
69
+ adc_channel .config .config .ain = (obj -> adc_pin );
70
+ adc_channel .p_next = NULL ;
64
71
65
72
66
73
ret_code_t ret_code ;
Original file line number Diff line number Diff line change @@ -142,6 +142,35 @@ __attribute__((naked)) void COMMON_RTC_IRQ_HANDLER(void)
142
142
);
143
143
}
144
144
145
+ #elif defined (__ICCARM__ )//IAR
146
+ void common_rtc_irq_handler (void );
147
+
148
+ __stackless __task void COMMON_RTC_IRQ_HANDLER (void )
149
+ {
150
+ uint32_t temp ;
151
+
152
+ __asm volatile (
153
+ " ldr %[temp], [%[reg2check]] \n"
154
+ " cmp %[temp], #0 \n"
155
+ " beq 1f \n"
156
+ " bl.w OS_Tick_Handler \n"
157
+ "1: \n"
158
+ " push {r3, lr}\n"
159
+ " blx %[rtc_irq] \n"
160
+ " pop {r3, pc}\n"
161
+
162
+ : /* Outputs */
163
+ [temp ] "=&r" (temp )
164
+ : /* Inputs */
165
+ [reg2check ] "r" (0x40011144 ),
166
+ [rtc_irq ] "r" (common_rtc_irq_handler )
167
+ : /* Clobbers */
168
+ "cc"
169
+ );
170
+ (void )temp ;
171
+ }
172
+
173
+
145
174
#else
146
175
147
176
#error Compiler not supported.
@@ -345,7 +374,7 @@ uint32_t os_tick_val(void) {
345
374
return clock_cycles_by_tick - ((current_counter - next_tick_cc_value ) % clock_cycles_by_tick );
346
375
}
347
376
348
- return 0 ;
377
+ // return 0;
349
378
}
350
379
351
380
#endif // defined(TARGET_MCU_NRF51822)
You can’t perform that action at this time.
0 commit comments