chiark / gitweb /
cdb: Replace ad-hocery with use of offsetof/typeof. Closes:#812718.
[chiark-tcl.git] / wiringpi / wiringpi.c
index 3b6348d2690890f71b7a6be486d1c894f5178bc3..eaf05eb5320cac49636595f03cb3e0f4ab07e380 100644 (file)
@@ -137,7 +137,7 @@ int cht_do_wiringpitcl_boardId(ClientData cd, Tcl_Interp *ip,
            &ints[3],
            &ints[4]);
   int i;
-  for (i=0; i<N; i++) objl[i]= Tcl_NewIntObj(ints[i]);
+  for (i=0; i<N; i++) objl[i]= cht_ret_int(ip, ints[i]);
   *result= Tcl_NewListObj(N,objl);
   return TCL_OK;
 #undef N
@@ -163,6 +163,18 @@ int cht_do_wiringpitcl_pwmr(ClientData cd, Tcl_Interp *ip, int range) {
   return TCL_OK;
 }
 
+int cht_do_wiringpitcl_pwm_bal(ClientData cd, Tcl_Interp *ip) {
+  CHECK_SETUP;
+  pwmSetMode(PWM_MODE_BAL);
+  return TCL_OK;
+}
+
+int cht_do_wiringpitcl_pwm_ms(ClientData cd, Tcl_Interp *ip) {
+  CHECK_SETUP;
+  pwmSetMode(PWM_MODE_MS);
+  return TCL_OK;
+}
+
 /*---------- families of operations ----------*/
 
 #define SIMPLE_READER_OP(op, wpicall)                          \